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); } }
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; } }