Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public void Unregister(MailManager mm)
 {
     mm.m_NewMail -= FaxMsg;
 }
Ejemplo n.º 3
0
 public Fax(MailManager mm)
 {
     Console.WriteLine("Register FaxMsg");
     mm.m_NewMail += FaxMsg;
 }