private void buttonStopServer_Click(object sender, EventArgs e) { ExitTimeForm etfDialog = new ExitTimeForm(); etfDialog.Minutes = config.LastShutdownTime; etfDialog.RestartEnabled = config.RestartServer; if (etfDialog.ShowDialog(this) == DialogResult.OK) { if (!etfDialog.RestartEnabled) { serverStatus = ServerMode.Stopped; } ServerAPI.ExitTimer(etfDialog.Minutes * 60, "Server is Shutting Down in " + etfDialog.Minutes + " minutes!!"); config.LastShutdownTime = etfDialog.Minutes; config.RestartServer = etfDialog.RestartEnabled; config.SaveConfig(); } etfDialog.Dispose(); }
public void ExecuteTask() { ServerAPI.ExitTimer(MinuteTimeout * 60, Message); }