public static void Main() { EventLogic e1 = new EventLogic(); TestingProgram1 p1 = new TestingProgram1(); TestingProgram2 p2 = new TestingProgram2(); // Register to the events e1.ProcessCompleted += E1_ProcessCompleted; e1.ProcessCompleted += E2_ProcessCompleted; // Register another class's event e1.ProcessCompleted += p1.E3_ProcessCompleted; // Call Testing Program's Event Handler p2.Func2(e1); e1.TestingFunc(); return; }
public void Func2(EventLogic e2) { e2.ProcessCompleted += E4_ProcessCompleted; return; }