private void logout_LinkClicked(object sender, System.EventArgs e) { if (EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Login_quit, new string[0]), MessageBoxButtons.YesNo) == DialogResult.Yes) { this.Logout(); ClientAPI.Logout(); ClientAPI.StopBroadcastChannel(); EcoGlobalVar.stopalltimer(true); Program.ExitApp(); } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Login_quit, new string[0]), MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; return; } this.Logout(); ClientAPI.StopBroadcastChannel(); EcoGlobalVar.stopalltimer(true); Program.ExitApp(); }
private void comm_butClick(object sender, System.EventArgs e) { string name = ((Button)sender).Name; this.enegManPage1.Visible = false; this.userManPage1.Visible = false; this.devManPage1.Visible = false; this.sysManPage1.Visible = false; this.logPage1.Visible = false; if (name.Equals(this.butOutletAccess.Name)) { EcoGlobalVar.stopalltimer(false); this.enegManPage1.Visible = true; this.CurSelMainTab = 0; this.butOutletAccess.Image = Resources.t_outletaccess_over; this.butUser.Image = Resources.t_usermanage; this.butDevice.Image = Resources.t_devicemanage; this.butSysManagement.Image = Resources.t_maintenance; this.butLog.Image = Resources.t_log; } else { if (name.Equals(this.butUser.Name)) { EcoGlobalVar.stopalltimer(false); this.userManPage1.Visible = true; this.CurSelMainTab = 1; this.butOutletAccess.Image = Resources.t_outletaccess; this.butUser.Image = Resources.t_usermanage_over; this.butDevice.Image = Resources.t_devicemanage; this.butSysManagement.Image = Resources.t_maintenance; this.butLog.Image = Resources.t_log; } else { if (name.Equals(this.butDevice.Name)) { EcoGlobalVar.stopalltimer(false); this.devManPage1.Visible = true; this.CurSelMainTab = 2; this.butOutletAccess.Image = Resources.t_outletaccess; this.butUser.Image = Resources.t_usermanage; this.butDevice.Image = Resources.t_devicemanage_over; this.butSysManagement.Image = Resources.t_maintenance; this.butLog.Image = Resources.t_log; } else { if (name.Equals(this.butSysManagement.Name)) { EcoGlobalVar.stopalltimer(false); this.sysManPage1.Visible = true; this.CurSelMainTab = 3; this.butOutletAccess.Image = Resources.t_outletaccess; this.butUser.Image = Resources.t_usermanage; this.butDevice.Image = Resources.t_devicemanage; this.butSysManagement.Image = Resources.t_maintenance_over; this.butLog.Image = Resources.t_log; } else { if (name.Equals(this.butLog.Name)) { EcoGlobalVar.stopalltimer(false); this.logPage1.Visible = true; this.CurSelMainTab = 4; this.butOutletAccess.Image = Resources.t_outletaccess; this.butUser.Image = Resources.t_usermanage; this.butDevice.Image = Resources.t_devicemanage; this.butSysManagement.Image = Resources.t_maintenance; this.butLog.Image = Resources.t_log_over; } } } } } this.pblogout.BringToFront(); if (EcoGlobalVar.gl_LoginUser.UserType != 1) { this.pbmonitor.BringToFront(); } else { this.pbmonitor.Visible = false; this.pbIdleTm.Location = this.pbmonitor.Location; } this.pbIdleTm.BringToFront(); this.butOutletAccess.ForeColor = Color.FromArgb(0, 168, 150); this.butUser.ForeColor = Color.FromArgb(0, 168, 150); this.butDevice.ForeColor = Color.FromArgb(0, 168, 150); this.butSysManagement.ForeColor = Color.FromArgb(0, 168, 150); this.butLog.ForeColor = Color.FromArgb(0, 168, 150); ((Button)sender).ForeColor = Color.FromArgb(211, 211, 212); }