Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Subscriber1 s1 = new Subscriber1();
            Subscriber2 s2 = new Subscriber2();
            Subscriber3 s3 = new Subscriber3();

            CountdownClock.CountdownClock cc = new CountdownClock.CountdownClock(1);

            cc.TimeOut += s1.TimeOutEventHandle;
            cc.TimeOut += s2.TimeOutEventHandle;
            cc.TimeOut += s3.TimeOutEventHandle;

            Console.WriteLine();
            cc.Start();

            cc.TimeOut          -= s2.TimeOutEventHandle;
            cc.IntervalInSeconds = 2;

            Console.WriteLine();
            cc.Start();

            cc.TimeOut += s1.TimeOutEventHandle;
            cc.TimeOut += s2.TimeOutEventHandle;

            Console.WriteLine();
            cc.Start();
            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Subscriber1 s1 = new Subscriber1();
            Subscriber2 s2 = new Subscriber2();
            Subscriber3 s3 = new Subscriber3();

            CountdownClock.CountdownClock cc = new CountdownClock.CountdownClock(1);

            cc.TimeOut += s1.TimeOutEventHandle;
            cc.TimeOut += s2.TimeOutEventHandle;
            cc.TimeOut += s3.TimeOutEventHandle;

            Console.WriteLine();
            cc.Start();

            cc.TimeOut -= s2.TimeOutEventHandle;
            cc.IntervalInSeconds = 2;

            Console.WriteLine();
            cc.Start();

            cc.TimeOut += s1.TimeOutEventHandle;
            cc.TimeOut += s2.TimeOutEventHandle;

            Console.WriteLine();
            cc.Start();
            Console.ReadKey();
        }