Example #1
0
        private bool CheckMasterPasswordForQuit()
        {
            if (_ui._station != null)
            {
                var d = new CheckMasterPasswordDialog(_ui, "The master password is required to shut down this station.");
                d.Owner = this;
                d.ShowDialog();

                if (d.IsCancel)
                {
                    return(false);
                }
                else if (d.DialogResult.HasValue &&
                         d.DialogResult == true)
                {
                    _ui.CloseStation();
                    Environment.Exit(0);
                }
                else
                {
                    FlexibleMessageBox.Show(_ui._stationNativeWindow,
                                            "Master password entered incorrctly, please try again.", "Incorrect Master Password", MessageBoxButtons.OK);
                    return(false);
                }
            }
            else
            {
                Environment.Exit(0);
            }
            return(true);
        }