Esempio n. 1
0
 static void Main()
 {
     Metronome m = new Metronome();
     Listener l = new Listener();
     l.Subscribe(m);
     m.Start();
 }
 static void Main()
 {
     Metronome m = new Metronome();
     Listener l = new Listener();
     l.Subscribe(m);
     m.Start();
     for (int i = 0; i < 300; i++)
     {
         Console.WriteLine("Executing Line " + i);
         System.Threading.Thread.Sleep(3000);
     }
 }
        static void Main()
        {
            Metronome m = new Metronome();
            Listener  l = new Listener();

            l.Subscribe(m);
            m.Start();
            for (int i = 0; i < 300; i++)
            {
                Console.WriteLine("Executing Line " + i);
                System.Threading.Thread.Sleep(3000);
            }
        }
        static void Main()
        {
            Metronome m = new Metronome();
            Listener  l = new Listener();

            //   l.Subscribe(m);
            //    m.OnPopupOccured();
            m.PopupOccured += new Metronome.popupEventHandler(l.HeardIt);
            for (int i = 0; i < 300; i++)
            {
                Console.WriteLine("Executing Line " + i);
                System.Threading.Thread.Sleep(3000);
            }
        }
 private void HeardIt(Metronome m, EventArgs e, int temperature, int humidity, int pressure)
 {
     System.Console.WriteLine(temperature);
     System.Console.WriteLine(humidity);
     System.Console.WriteLine(pressure);
 }
 public void Subscribe(Metronome m)
 {
     m.Tick += new Metronome.TickHandler(HeardIt);
 }
 private void HeardIt(Metronome m, EventArgs e)
 {
     System.Console.WriteLine("HEARD IT");
 }
 public void Subscribe(Metronome m)
 {
     m.PopupOccured += new Metronome.popupEventHandler(HeardIt);
 }
 public void Subscribe(Metronome m)
 {
     m.Ticked += new Metronome.TickEventHandler(HeardIt);              //<- subscribe to the event
 }
 public void HeardIt(Metronome m, EventArgs e)
 {
     Console.WriteLine("Popup Ocured");
     //if (m.IswindowExists() == true)
     //{
     //    m.closepopup();
     //}
 }
 public void Subscribe(Metronome m)
 {
     
     m.PopupOccured += new Metronome.popupEventHandler(HeardIt);
     
     
 }
 static void Main()
 {
     Metronome m = new Metronome();
     Listener l = new Listener();
  //   l.Subscribe(m);
 //    m.OnPopupOccured();
     m.PopupOccured += new Metronome.popupEventHandler( l.HeardIt);
     for (int i = 0; i < 300; i++)
     {
         Console.WriteLine("Executing Line "+i);
         System.Threading.Thread.Sleep(3000);
     }
 }
 private void HeardIt(Metronome m, EventArgs e)
 {
     System.Console.WriteLine("HEARD IT");
 }
 public void Subscribe(Metronome m)
 {
     m.Tick += new Metronome.TickHandler(HeardIt);
 }