Beispiel #1
0
        private void DialogUnsavedCollection_DialogCompleted(object sender, ClosingUnsavedDialogButtonClickedEventArgs e)
        {
            if (e.DialogResult == DialogResult.Abort)
            {
                abortShowDialogs = true;
                OnUnsavedDialogsCompleted(new ClosingUnsavedDialogButtonClickedEventArgs(e.DialogResult));
                return;
            }

            if (e.DialogResult == DialogResult.Yes)
            {
                unsavedCollections[currentDialogIndex].Save();
            }
            else
            {
                unsavedCollections[currentDialogIndex].Load();
            }

            currentDialogIndex++;

            if (currentDialogIndex < unsavedCollections.Count)
            {
                ShowDialogForUnsavedCollection(e.TargetTab);
            }
            else
            {
                OnUnsavedDialogsCompleted(new ClosingUnsavedDialogButtonClickedEventArgs(e.DialogResult));
            }
        }
 protected virtual void OnDialogCompleted(ClosingUnsavedDialogButtonClickedEventArgs e)
 {
     DialogCompleted?.Invoke(this, e);
 }