Пример #1
0
 protected virtual void OnRaiseCustomEvent(SampleEvent e)
 {
     CustomEventHandler handler = RaiseCustomEvent;
     if (handler != null)
     {
         e.SampleMessage += String.Format(" at {0}", DateTime.Now);
         handler(this, e);
     }
 }
Пример #2
0
 void HandleCustomEvent(object sender, SampleEvent e)
 {
     Console.WriteLine("\nThis is how the event is handled:\n");
     Console.WriteLine(this.name + " received this message: {0}", e.SampleMessage);
 }