public void NotifySubsriber(SomeEventArgs e) { var handler = EventHandler; if (handler != null) { handler(this, e); } }
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}"); } }