private void ResetWordHistory(object sender, ExecutedRoutedEventArgs e) { if (!ConfirmationWindow.Confirm(Window.GetWindow(this), string.Format("Reset history for word '{0}'?", WordInfo.Word.Name))) { return; } WordInfo.WordList.ResetWordHistory(WordInfo.Word.Name); }
private void ResetHistory(object sender, ExecutedRoutedEventArgs e) { if (!ConfirmationWindow.Confirm(this, "Reset history for all words?")) { return; } CramToolModel.Instance.WordList.ResetHistory(); }
private void DeleteRecentFile(object sender, ExecutedRoutedEventArgs e) { string filename = e.Parameter as string; if (filename == null) { return; } if (!ConfirmationWindow.Confirm(Window.GetWindow(this), string.Format("Remove file '{0}' from the list of recent files?", filename))) { return; } CramToolModel.Instance.DeleteRecentFile(filename); }
private bool CheckSaved() { if (EditableWord == null) { return(true); } string name = EditableWord.Name; if (string.IsNullOrWhiteSpace(name)) { name = "<unnamed>"; } if (!ConfirmationWindow.Confirm(Window.GetWindow(this), string.Format("Unsaved changes to word '{0}' will be lost.\nAre you sure you want to continue?", name))) { return(false); } EditableWord = null; return(true); }