Beispiel #1
0
        protected virtual void OnRaiseCustomEvent(CustomEventArguments e)
        {
            EventHandler <CustomEventArguments> handler = RaiseCustomEvent;

            if (handler != null)
            {
                e.Message += String.Format(" at {0}", DateTime.Now.ToString());

                handler(this, e);
            }
        }
Beispiel #2
0
 // Define what actions to take when the event is raised.
 void HandleCustomEvent(object sender, CustomEventArguments e)
 {
     Console.WriteLine(" Subscriber " + id + " received this message: {0}", e.Message);
 }