public static void Main()
        {
            Client1 c1_o1 = new Client1("Object1 of Client1 class");

            Evt += new LinkToEventHandler(c1_o1.Client1EventHandler);
            DoSomething();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Client1 c1 = new Client1("object c1 of Client1 class");

            Evt += new LinkToEventHandler(c1.Client1EventHandler);
            DoSomething(); // invoking(step 3)
            Console.Read();
        }
        public static void Main()
        {
            Client1 c1_o1 = new Client1("Object1 of Client1 class");
            Client1 c1_o2 = new Client1("Object2 of Client1 class");
            Client1 c1_o3 = new Client1("Object3 of Client1 class");

            Client2 c2_o1 = new Client2("Object1 of Client2 class");
            Client2 c2_o2 = new Client2("Object2 of Client2 class");
            Client2 c2_o3 = new Client2("Object3 of Client2 class");

            Evt += new LinkToEventHandler(c1_o1.Client1EventHandler);
            Evt += new LinkToEventHandler(c1_o2.Client1EventHandler);
            Evt += new LinkToEventHandler(c1_o3.Client1EventHandler);

            Evt += new LinkToEventHandler(c2_o1.Client2EventHandler);
            Evt += new LinkToEventHandler(c2_o2.Client2EventHandler);
            Evt += new LinkToEventHandler(c2_o3.Client2EventHandler);

            DoSomething();
            Console.Read();
        }