public Form1() { InitializeComponent(); pictureBox1.Image = Properties.Resources.jw_logo_누끼; notifyIcon1.ContextMenuStrip = contextMenuStrip1; /// 설정 파일 읽기 m_cfg = new ConfigManager(this); GetCfgManager().setFileName(System.AppDomain.CurrentDomain.BaseDirectory + @"WDT.ini"); GetCfgManager().Load(); this.Text += " " + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion.ToString(); #if true try { eapi = new EAPI_Library(); } catch (System.Exception se) { throw se; } #endif InitialEAPI_Library(); }
private void ToolStripMenuItemExit_Click(object sender, EventArgs e) { notifyIcon1.Dispose(); Application.ExitThread(); EAPI_Library.EApiWDogStop(); this.timerWatchdog.Stop(); }
private void InitialEAPI_Library() { #if true UInt32 pMaxDelay = new UInt32(), pMaxEventTimeout = new UInt32(), pMaxResetTimeout = new UInt32(); if (0 != EAPI_Library.EApiWDogGetCap(ref pMaxDelay, ref pMaxEventTimeout, ref pMaxResetTimeout)) { this.tableLayoutPanel_form.Enabled = false; } #endif /// 시작 여부 numericUpDown_timer.Value = Convert.ToDecimal(m_wdtTime); refresh_UpDown.Value = Convert.ToDecimal(m_wdtRefreshTime); if (m_wdtEnable) { ///와치독 enable이면 자동으로 시작한다. button_start_stop_Click(this, null); } }
private void button_start_stop_Click(object sender, EventArgs e) { this.button_start_stop.Text = this.button_trigger.Enabled ? "Start" : "Stop"; this.button_trigger.Enabled = !this.button_trigger.Enabled; if (this.button_trigger.Enabled) { uint timeout = Decimal.ToUInt32(this.numericUpDown_timer.Value); this.label_timer.Text = timeout.ToString(); EAPI_Library.EApiWDogStart(0, 0, timeout * 1000); this.timerWatchdog.Start(); } else { EAPI_Library.EApiWDogStop(); this.timerWatchdog.Stop(); } m_wdtEnable = this.button_trigger.Enabled; m_cfg.Save(); }
private void button_trigger_Click(object sender, EventArgs e) { EAPI_Library.EApiWDogTrigger(); this.label_timer.Text = this.numericUpDown_timer.Value.ToString(); }