Beispiel #1
0
        private bool ConfirmChangesSaved()
        {
            WordList wordList = CramToolModel.Instance.WordList;

            if (wordList == null || !wordList.Modified)
            {
                return(true);
            }
            UnsavedChangesWindow win = new UnsavedChangesWindow();

            win.Owner   = this;
            win.Message = string.Format("Do you want to save changes to {0}?", CramToolModel.Instance.ShortDictPath);
            win.ShowDialog();

            UnsavedChangesHandling result = win.Result;

            if (result == UnsavedChangesHandling.Cancel)
            {
                return(false);
            }
            if (result == UnsavedChangesHandling.Ignore)
            {
                return(true);
            }
            try
            {
                return(SaveDictionary());
            }
            catch (Exception e)
            {
                App.HandleException(this, e);
                return(false);
            }
        }
Beispiel #2
0
 private void ReturnIgnore(object sender, RoutedEventArgs e)
 {
     Result       = UnsavedChangesHandling.Ignore;
     DialogResult = true;
 }
 private void ReturnIgnore(object sender, RoutedEventArgs e)
 {
     Result = UnsavedChangesHandling.Ignore;
     DialogResult = true;
 }