示例#1
0
        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();
            }
        }
示例#2
0
文件: Main.cs 项目: mumu/NotepadClone
        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();
            }
        }