protected virtual void OnRaiseCustomEvent(SomeEvent e)
 {
     CustomEventHandler handler = RaiseCustomEvent;
     if (handler != null)
     {
         e.Message += String.Format(" at {0}", DateTime.Now);
         handler(this, e);
     }
 }
Beispiel #2
0
        protected virtual void OnRaiseCustomEvent(SomeEvent e)
        {
            CustomEventHandler handler = RaiseCustomEvent;

            if (handler != null)
            {
                e.Message += String.Format(" at {0}", DateTime.Now);
                handler(this, e);
            }
        }
 void HandleSomeEvent(object sender, SomeEvent e)
 {
     Console.WriteLine("\nThis is how the event is handled:\n");
     Console.WriteLine(this.name + " received this message: {0}", e.Message);
 }
 void HandleSomeEvent(object sender, SomeEvent e)
 {
     Console.WriteLine("\nThis is how the event is handled:\n");
     Console.WriteLine(this.name + " received this message: {0}", e.Message);
 }