Exemple #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();
        }
Exemple #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();
        }
Exemple #3
0
 public Client1(EventHolder events)
 {
     events.Initialize += InitializeHandler;
     events.Terminate  += TerminateHandler;
 }
Exemple #4
0
 public Client2(EventHolder events)
 {
     Events = events;
     AddInitialize();
     AddTerminate();
 }
Exemple #5
0
 public Client2(EventHolder events)
 {
     Events = events;
     AddInitialize();
     AddTerminate();
 }
Exemple #6
0
 public Client1(EventHolder events)
 {
     events.Initialize += InitializeHandler;
     events.Terminate += TerminateHandler;
 }