Example #1
0
 private void CloseWithTagSave(object sender, RoutedEventArgs e)
 {
     if (QuestionBox.ShowMessage(this, Properties.Resources.SaveOnlyQuestion, Properties.Resources.ReallyClosing, false) == MessageBoxResult.Yes)
     {
         Result = (MessageBoxResult)((Button)sender).Tag;
     }
 }
        private bool CheckAndReturn(MessageBoxResult messageBoxResult)
        {
            if (!CheckPassword && messageBoxResult == MessageBoxResult.Cancel)
            {
                return(false);
            }
            if (CheckPassword && messageBoxResult == MessageBoxResult.OK && !GetPlainPassword().Equals(Password))
            {
                IsCorrectPassword = false;
                return(true);
            }

            if (!CheckPassword && messageBoxResult == MessageBoxResult.OK && string.IsNullOrEmpty(Password))
            {
                return(false);
            }

            if (!CheckPassword && (!Settings.Default.AllowEmptyQuestions && Settings.Default.AskForPassword) && string.IsNullOrEmpty(PasswordQuestion))
            {
                IsValidQuestion = false;
                return(true);
            }

            if (!CheckPassword && !ShowPlainText && Password != GetPlainPassword())
            {
                return(QuestionBox.ShowMessage(this, Properties.Resources.PasswordIsHidden, Properties.Resources.ApplyChanges, false) == MessageBoxResult.No);
            }


            return(false);
        }