void tsLog_Clear_Click(object sender, EventArgs e) { if (Popup.OKCancel("Are you sure you want to clear logs?", "Clear logs")) { main_txtLog.ClearLog(); } }
void main_BtnRestart_Click(object sender, EventArgs e) { if (Popup.OKCancel("Are you sure you want to restart?", "Restart")) { Server.Stop(true, Server.Config.DefaultRestartMessage); } }
void chkVerify_CheckedChanged(object sender, EventArgs e) { if (!warnDisabledVerification || adv_chkVerify.Checked) { return; } if (Popup.OKCancel(warnMsg, "Security warning")) { return; } adv_chkVerify.Checked = true; }
void Window_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.WindowsShutDown) { Server.Stop(false, "Server shutdown - PC turning off"); notifyIcon.Dispose(); } if (Server.shuttingDown || Popup.OKCancel("Really shutdown the server? All players will be disconnected!", "Exit")) { Server.Stop(false, Server.Config.DefaultShutdownMessage); notifyIcon.Dispose(); } else { // Prevents form from closing when user clicks the X and then hits 'cancel' e.Cancel = true; } }