static void Main(string[] args)
        {
            TimerEvent timer = new TimerEvent(5000);

            timer.TimeOut += FirstClass.SomeWork;
            timer.TimeOut += SecondClass.SomeWork;
            timer.Start();
            Console.ReadKey();
        }
Example #2
0
        private void OnPopUp(object sender, ElapsedEventArgs e)
        {
            if (Height < 120)
            {
                Invoke(OnHeight, 0);
            }
            else
            {
                TimerEvent.Stop();
                TimerEvent.Elapsed -= new ElapsedEventHandler(OnPopUp);
                TimerEvent.Elapsed += new ElapsedEventHandler(OnPopOut);
                TimerEvent.Interval = 3000;
                TimerEvent.Start();
            }

            Application.DoEvents();
        }