static void MainEventTest(string[] args) { MailManager mm = new MailManager(); Fax fax = new Fax(mm); mm.SimulateNewMail("yy1", "yy2", "yys"); TypeWithLotsOfEvents twie = new TypeWithLotsOfEvents(); twie.Foo += HandleFooEvent; twie.Foo += HandleFooEvent1; twie.Foo += HandleFooEvent2; twie.SimulateFoo("yytest"); Console.ReadLine(); }
public void Unregister(MailManager mm) { mm.m_NewMail -= FaxMsg; }
public Fax(MailManager mm) { Console.WriteLine("Register FaxMsg"); mm.m_NewMail += FaxMsg; }