public event EventHandler <MyTCEventArgs> Elapsed; // Event declaration private void OnOneSecond(object obj, EventArgs e) { if (Elapsed != null) { MyTCEventArgs mtcea = new MyTCEventArgs("Message from OnOneSecond"); Elapsed(obj, mtcea); } }
public void TimerHandlerA(object obj, MyTCEventArgs e) { Console.WriteLine("Class A Message: {0}", e.Message); }