コード例 #1
0
ファイル: Main.cs プロジェクト: svn2github/autowikibrowser
        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();
            }
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: svn2github/autowikibrowser
        private void Shutdown()
        {
            if (CanShutdown)
            {
                ShutdownTimer.Enabled = true;
                ShutdownTimer.Start();
                ShutdownNotification shut = new ShutdownNotification { ShutdownType = GetShutdownType() };

                switch (shut.ShowDialog(this))
                {
                    case DialogResult.Cancel:
                        ShutdownTimer.Stop();
                        ShutdownTimer.Enabled = false;
                        MessageBox.Show(GetShutdownType() + " aborted!");
                        return;
                    case DialogResult.OK:
                        ShutdownComputer();
                        break;
                }
            }
        }
コード例 #3
0
ファイル: Main.cs プロジェクト: svn2github/autowikibrowser
        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();
            }
        }