示例#1
0
 void tsLog_Clear_Click(object sender, EventArgs e)
 {
     if (Popup.OKCancel("Are you sure you want to clear logs?", "Clear logs"))
     {
         main_txtLog.ClearLog();
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 void chkVerify_CheckedChanged(object sender, EventArgs e)
 {
     if (!warnDisabledVerification || adv_chkVerify.Checked)
     {
         return;
     }
     if (Popup.OKCancel(warnMsg, "Security warning"))
     {
         return;
     }
     adv_chkVerify.Checked = true;
 }
示例#4
0
        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;
            }
        }