Пример #1
0
        private bool CheckForConfigurationChanges()
        {
            if (ClientConfiguration.Count != 0 && ClientConfiguration.IsDirty)
            {
                DialogResult result = MessageBox.AskYesNoCancelQuestion(Form,
                                                                        String.Format("There are changes to the configuration that have not been saved.  Would you like to save these changes?{0}{0}Yes - Continue and save the changes{0}No - Continue and do not save the changes{0}Cancel - Do not continue", Environment.NewLine),
                                                                        Core.Application.NameAndVersion);

                switch (result)
                {
                case DialogResult.Yes:
                    FileSaveClick();
                    return(!ClientConfiguration.IsDirty);

                case DialogResult.No:
                    return(true);

                case DialogResult.Cancel:
                    return(false);
                }
                return(false);
            }

            return(true);
        }