HeartBeatMonitor.cs 838 Bytes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace MoyaSignup
{
    public class HeartBeatMonitor
    {
        Thread thdMonitorLoop;
        private bool run = true;
        public HeartBeatMonitor()
        {
            thdMonitorLoop = new Thread(new ThreadStart(monitorLoop));
            thdMonitorLoop.Start();

        }
        public void Stop()
        {
            run = false;

        }
        private void monitorLoop()
        {
            while (run)
            {
                Thread.Sleep(100);
                if (Program.HeartBeat.AddMilliseconds(4000) < System.DateTime.Now)
                {
                    Application.Run(new MoyaSignup.WaitForm());
                }
            }

        }
    }
}