Exemplo n.º 1
0
        public void NotifySubsriber(SomeEventArgs e)
        {
            var handler = EventHandler;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 2
0
        public void SomeMethodTobeCalled(object sender, SomeEventArgs e)
        {
            Console.WriteLine($"{SubsriberName} will be called.");
            Console.WriteLine($"From Publisher: SomeEventArgs's Name is {e.SomeName}");
            var t = sender as Publisher;

            if (t != null)
            {
                Console.WriteLine($"From Publisher: Publisher's Name is {t.PublisherName}");
            }
        }