Exemple #1
0
        private void PromptUnsavedChangesCloseTab(TabExtraInfo tabInfo)
        {
            UnsavedChangesSingleFile unsavedChangesBox = new UnsavedChangesSingleFile();

            unsavedChangesBox.ShowDialog();

            switch (unsavedChangesBox.GetUserAnswer())
            {
            case UnsavedChangesSingleFile.saveAndClose:
                Save(tabInfo.GetAssocaitedFileName(), tabControl1.SelectedIndex);
                DeleteTab();
                break;

            case UnsavedChangesSingleFile.closeWithoutSaving:
                DeleteTab();
                break;

            case UnsavedChangesSingleFile.Cancel:
                break;
            }
        }
Exemple #2
0
        private bool PromptUnsavedChangesOpenTab(TabExtraInfo tabInfo)
        {
            UnsavedChangesSingleFile unsavedChangesBox = new UnsavedChangesSingleFile();

            unsavedChangesBox.ShowDialog();

            switch (unsavedChangesBox.GetUserAnswer())
            {
            case UnsavedChangesSingleFile.saveAndClose:
                Save(tabInfo.GetAssocaitedFileName(), tabControl1.SelectedIndex);
                return(true);

            case UnsavedChangesSingleFile.closeWithoutSaving:
                return(true);

            case UnsavedChangesSingleFile.Cancel:
                return(false);

            default:
                return(false);    // Should be unreachable
            }
        }