static void Main(string[] args) { SomethingToObserve so = new SomethingToObserve(); so.OnStateChange += So_OnStateChange; so.StartSomeRandomWork(); }
private static void So_OnStateChange(object source, MyNewEventArguments e) { SomethingToObserve sender = (SomethingToObserve)source; Console.WriteLine("Callback recieved from the Observed item: " + sender.Name); }