private void notifyMenu_Exit_Click(object sender, EventArgs e) { try { if (mesServer != null && mesServer.State == ServerState.Running) { if (DialogResult.Yes == MessageUtilSkin.ShowYesNoAndTips("服务正在运行,请先关闭服务.")) { TabControl1.SelectedIndex = 0; if (this.WindowState == FormWindowState.Minimized) { this.WindowState = FormWindowState.Maximized; this.Show(); this.BringToFront(); this.Activate(); this.Focus(); } } } else { if (DialogResult.Yes == MessageUtilSkin.ShowYesNoAndTips("是否确定退出程序?")) { this.ShowInTaskbar = false; Application.Exit(); } } } catch { // Nothing to do. } }
private void tsmItemRestart_Click(object sender, EventArgs e) { if (mesServer != null && mesServer.State == ServerState.Running) { if (DialogResult.Yes == MessageUtilSkin.ShowYesNoAndTips("服务正在运行,请先关闭服务.")) { TabControl1.SelectedIndex = 0; return; } } else { if (DialogResult.Yes == MessageUtilSkin.ShowYesNoAndTips("是否注销系统,重新登陆。")) { this.ShowInTaskbar = false; Application.Exit(); Application.Restart(); Environment.Exit(0); } } }