private bool EnsureWorkNotLost() { if (!IsDirty) { return(true); } var DialogResult = new SaveChangesPrompt(Filename).ShowDialog(this); switch (DialogResult) { case DialogResult.Yes: return(Save()); case DialogResult.No: return(true); case DialogResult.Cancel: return(false); default: throw new Exception(); } }
private bool EnsureWorkNotLost() { if (!IsDirty) return true; var DialogResult = new SaveChangesPrompt(Filename).ShowDialog(this); switch(DialogResult) { case DialogResult.Yes: return Save(); case DialogResult.No: return true; case DialogResult.Cancel: return false; default: throw new Exception(); } }