Exemplo n.º 1
0
 public CountDownTimerDisplay1(CountDownClock cdc)
 {
     cdc.TimeExpired += delegate(object s, CountDownClockEventArgs e)
     {
         Console.WriteLine("2-you requested to recive this message : {0}", e.message);
     };
 }
Exemplo n.º 2
0
 public CountDownTimerDisplay2(CountDownClock cdc)
 {
     cdc.TimeExpired += (sender, e) =>
     {
         Console.WriteLine("3-you requested to recive this message : {0}", e.message);
     };
 }
Exemplo n.º 3
0
 public CountDownTimerDisplay(CountDownClock cdc)
 {
     myHandler        = new CountDownClock.TimesUpEventHandler(HeardIt);
     cdc.TimeExpired += myHandler;
     myHandler        = new CountDownClock.TimesUpEventHandler(HeardIt1);
     cdc.TimeExpired += myHandler;
 }
Exemplo n.º 4
0
        static void Main()
        {
            Console.WriteLine("enter your message");
            string message = Console.ReadLine();

            Console.WriteLine("how many second to wait");
            int                    seconds  = Convert.ToInt32(Console.ReadLine());
            CountDownClock         cdc      = new CountDownClock(message, seconds);
            CountDownTimerDisplay  display  = new CountDownTimerDisplay(cdc);
            CountDownTimerDisplay1 display1 = new CountDownTimerDisplay1(cdc);
            CountDownTimerDisplay2 display2 = new CountDownTimerDisplay2(cdc);

            cdc.Run();
            Console.ReadLine();
        }