Example #1
0
        private void Run()
        {
            Events = new EventHolder();
            var c1 = new Client1(Events);
            var c2 = new Client2(Events);

            Console.WriteLine("Invoking all events...");
            InvokeEvents();

            c2.RemoveInitialize();
            Console.WriteLine("RemoveInitialize and invoking...");
            InvokeEvents();

            c2.AddInitialize();
            Console.WriteLine("AddInitialize and invoking...");
            InvokeEvents();

            c2.RemoveTerminate();
            Console.WriteLine("RemoveTerminate and invoking...");
            InvokeEvents();

            c2.AddTerminate();
            Console.WriteLine("AddTerminate and invoking...");
            InvokeEvents();
        }
Example #2
0
        private void Run()
        {
            Events = new EventHolder();
            var c1 = new Client1(Events);
            var c2 = new Client2(Events);

            Console.WriteLine("Invoking all events...");
            InvokeEvents();

            c2.RemoveInitialize();
            Console.WriteLine("RemoveInitialize and invoking...");
            InvokeEvents();

            c2.AddInitialize();
            Console.WriteLine("AddInitialize and invoking...");
            InvokeEvents();

            c2.RemoveTerminate();
            Console.WriteLine("RemoveTerminate and invoking...");
            InvokeEvents();

            c2.AddTerminate();
            Console.WriteLine("AddTerminate and invoking...");
            InvokeEvents();
        }
Example #3
0
 public Client1(EventHolder events)
 {
     events.Initialize += InitializeHandler;
     events.Terminate  += TerminateHandler;
 }
Example #4
0
 public Client2(EventHolder events)
 {
     Events = events;
     AddInitialize();
     AddTerminate();
 }
Example #5
0
 public Client2(EventHolder events)
 {
     Events = events;
     AddInitialize();
     AddTerminate();
 }
Example #6
0
 public Client1(EventHolder events)
 {
     events.Initialize += InitializeHandler;
     events.Terminate += TerminateHandler;
 }