Ejemplo n.º 1
0
        public Test85()
        {
            var p = new Example1_85();

            p.OnChange += (sender, e) =>
            {
                Console.WriteLine("from test 85");
            };

            p.OnChange += (sender, e) =>
            {
                throw new Exception();
            };

            p.OnChange += (sender, e) =>
            {
                Console.WriteLine("subscriber 3 called.");
            };

            try
            {
                p.Raise();
            }
            catch (AggregateException e)
            {
                Console.WriteLine($"e.InnerExceptions.Count = {e.InnerExceptions.Count}");
            }
        }
Ejemplo n.º 2
0
        public static void DoProc()
        {
            var p = new Example1_85();

            p.OnChange += (sender, e) =>
            {
                Console.WriteLine($"event raised: {e.Value}");
            };

            // weakness does not solve...
            p.OnChange += (sender, e) => { };
            p.Raise();

            var p85 = new Test85();
        }