Hourglass.Windows.ThemeManagerWindow.PromptToSaveIfRequired C# (CSharp) Method

PromptToSaveIfRequired() private method

Prompts the user to save unsaved changes to the selected theme, if there are any.
private PromptToSaveIfRequired ( ) : bool
return bool
        private bool PromptToSaveIfRequired()
        {
            if (this.State == ThemeManagerWindowState.UserThemeEdited)
            {
                MessageBoxResult result = MessageBox.Show(
                    this /* owner */,
                    Properties.Resources.ThemeManagerWindowSavePrompt,
                    Properties.Resources.MessageBoxTitle,
                    MessageBoxButton.YesNoCancel,
                    MessageBoxImage.Question);

                switch (result)
                {
                    case MessageBoxResult.Yes:
                        this.SaveChanges();
                        return true;

                    case MessageBoxResult.No:
                        return true;

                    case MessageBoxResult.Cancel:
                        return false;
                }
            }

            return true;
        }