protected Dispose ( bool disposing ) : void | ||
disposing | bool | true if managed resources should be disposed; otherwise, false. |
Résultat | void |
private void Shutdown() { if (CanShutdown) { ShutdownTimer.Enabled = true; ShutdownNotification shut = new ShutdownNotification {ShutdownType = GetShutdownType()}; switch (shut.ShowDialog(this)) { case DialogResult.Cancel: ShutdownTimer.Enabled = false; MessageBox.Show(GetShutdownType() + " aborted!"); break; case DialogResult.Yes: if (GetShutdownType() == "Standby" || GetShutdownType() == "Hibernate") { shut.Close(); shut.Dispose(); ShutdownTimer.Enabled = false; } break; } ShutdownComputer(); } }
private void CanShutdown() { if (chkShutdown.Checked && listMaker.Count == 0) { ShutdownTimer.Enabled = true; ShutdownNotification shut = new ShutdownNotification(); shut.ShutdownType = GetShutdownType(); DialogResult result = shut.ShowDialog(this); if (result == DialogResult.Cancel) { ShutdownTimer.Enabled = false; MessageBox.Show(GetShutdownType() + " aborted!"); } else if (result == DialogResult.Yes) if (GetShutdownType() == "Standby" || GetShutdownType() == "Hibernate") { shut.Close(); shut.Dispose(); ShutdownTimer.Enabled = false; } ShutdownComputer(); } }