static void Main(string[] args)
        {
            EventSender senderVasya = new EventSender("Vasya");
            senderVasya.EventHandlers += new EventHandler(EventHandlerA);
            senderVasya.EventHandlers += new EventHandler(EventHandlerB);

            EventSender senderPetya = new EventSender("Petya");
            senderPetya.EventHandlers += EventHandlerA;

            senderVasya.SendEvent();
            senderPetya.SendEvent();

            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            EventSender senderVasya = new EventSender("Vasya");

            senderVasya.EventHandlers += new EventHandler(EventHandlerA);
            senderVasya.EventHandlers += new EventHandler(EventHandlerB);

            EventSender senderPetya = new EventSender("Petya");

            senderPetya.EventHandlers += EventHandlerA;

            senderVasya.SendEvent();
            senderPetya.SendEvent();

            Console.ReadKey();
        }
 static void EventHandlerB(EventSender sender)
 {
     Console.WriteLine("EventHandlerB: Sender " + sender.Name);
 }
Exemple #4
0
 static void EventHandlerB(EventSender sender)
 {
     Console.WriteLine("EventHandlerB: Sender " + sender.Name);
 }