public void Run()
 {
     Pub_1_87 p = new Pub_1_87();
     p.OnChange += (sender, e)
     => Console.WriteLine("Subscriber 1 called");
     p.OnChange += (sender, e)
     => { throw new Exception(); };
     p.OnChange += (sender, e)
     => Console.WriteLine("Subscriber 3 called");
     try
     {
         p.Raise();
     }
     catch (AggregateException ex)
     {
         Console.WriteLine(ex.InnerExceptions.Count);
     }
 }
Ejemplo n.º 2
0
        public void Run()
        {
            Pub_1_87 p = new Pub_1_87();

            p.OnChange += (sender, e)
                          => Console.WriteLine("Subscriber 1 called");
            p.OnChange += (sender, e)
                          => { throw new Exception(); };
            p.OnChange += (sender, e)
                          => Console.WriteLine("Subscriber 3 called");
            try
            {
                p.Raise();
            }
            catch (AggregateException ex)
            {
                Console.WriteLine(ex.InnerExceptions.Count);
            }
        }