예제 #1
0
        private void InitControl()
        {
            double sec;
            string sYear;
            string sMonth;
            string sDay;
            string sPath;

            m_bCheckUnisSystem = false;
            m_bCheckTerminal   = false;
            DateTime dt = DateTime.Now;

            sYear        = dt.ToString("yyyy");
            sMonth       = dt.ToString("MM");
            sDay         = dt.ToString("dd");
            txtDate.Text = sYear + "年" + sMonth + "月" + sDay + "日";
            sPath        = m_Wnd.GetLogFilePath() + "\\" + sYear;
            if (!System.IO.Directory.Exists(sPath))
            {
                System.IO.Directory.CreateDirectory(sPath);
            }
            m_sLogFileName = sPath + "\\" + sMonth + sDay + ".txt";
            if (m_Wnd.GetLogSave() == true)
            {
                LoadLogFile();
            }

            sec = m_Wnd.GetIntervalSec();

            m_dsptCheckUnis              = new DispatcherTimer(DispatcherPriority.Normal);
            m_dsptCheckUnis.Interval     = TimeSpan.FromMilliseconds(sec * 1000);
            m_dsptCheckUnis.Tick        += new EventHandler(TickCheckUnisLoop);
            m_dsptCheckTerminal          = new DispatcherTimer(DispatcherPriority.Normal);
            m_dsptCheckTerminal.Interval = TimeSpan.FromMilliseconds(sec * 1000);
            m_dsptCheckTerminal.Tick    += new EventHandler(TickCheckTerminalLoop);
#if DEBUG
#else
#endif
            m_dsptSendMail          = new DispatcherTimer(DispatcherPriority.Normal);
            m_dsptSendMail.Interval = TimeSpan.FromMilliseconds(sec * 1000);
            m_dsptSendMail.Tick    += new EventHandler(TickSendMailLoop);
#if DEBUG
            m_bCheckUnisSystem = true;
            m_bCheckTerminal   = true;
#else
            DoDispatch();
            CheckUnisProcess();

            DoDispatch();
            CheckTerminalPing();

            DoDispatch();
            m_dsptCheckUnis.Start();
            m_dsptCheckTerminal.Start();
#endif
            m_dsptSendMail.Start();
        }
예제 #2
0
        private void InitControl()
        {
            Boolean nFlag;

            nFlag = m_Wnd.GetStatusDisplay();
            chkStatusDisplay.IsChecked = nFlag;
            InitCmbInterval();
            cmbInterval.Text       = m_Wnd.GetIntervalSec().ToString();
            nFlag                  = m_Wnd.GetAdminSend();
            chkAdminSend.IsChecked = nFlag;
            nFlag                  = m_Wnd.GetLogSave();
            chkLogSave.IsChecked   = nFlag;
        }