コード例 #1
0
        void OnDocumentClosing(object sender, DocumentCancelEventArgs e)
        {
            BaseDocument doc  = e.Document;
            IdentKey     key  = doc.Tag as IdentKey;
            IView        view = null;

            if (key == null || !_views.TryGetValue(key, out view))
            {
                return;
            }

            if (!view.CanClose || !view.OnClosing(null))
            {
                e.Cancel = true;
            }
            else if (_documentManager.View.FloatDocuments.IndexOf(doc) == -1)
            {
                TabbedView tabbedView = _documentManager.View as TabbedView;
                //tabbedView.ReleaseDeferredLoadControl(e.Document);
                e.Cancel = true;
                doc.Form.Hide();
                doc.Form.MdiParent = null;
                tabbedView.Controller.RemoveDocument(doc);
                view.OnAfterClose();
                _views.Remove(key);
            }

            _logger.Debug("OnDocumentClosing event. " + view.ToString());
        }
コード例 #2
0
 void BeginFloating(object sender, DocumentCancelEventArgs e)
 {
     if (e.Document != null && e.Document.Caption == _frmAcceuil.Text)
     {
         e.Cancel = true;
     }
 }
コード例 #3
0
 private void tabbedView_DocumentClosing(object sender, DocumentCancelEventArgs e)
 {
     // tab closed request
     if (e.Document.Control is VisualControl)
     {
         // verify if it is possible to close and cancel event if not
         e.Cancel = !(e.Document.Control as VisualControl).checkClosable();
     }
 }
コード例 #4
0
        void _tabbedView_DocumentClosing(object sender, DocumentCancelEventArgs e)
        {
            WorkSpaceClosed workSpaceMsg = new WorkSpaceClosed();
            IWorkspace1     workspace    = e.Document.Control as IWorkspace1;

            workSpaceMsg.ModuleName    = workspace.ObjectName;
            workSpaceMsg.WorkSpaceName = workspace.ObjectName;

            EventAggregationManager.SendMessage(workSpaceMsg);
        }
コード例 #5
0
 public void DocumentClosingHandler(object sender, DocumentCancelEventArgs e)
 {
     if (TransactionalChangeHandler.ObjectsToSave(unitOfWork))
     {
         var answer = XtraMessageBox.Show("There are unsaved changes. Do you want to validate and save before closing the list?", "Question",
                                          MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
         if (answer == DialogResult.Yes)
         {
             if (!TransactionalChangeHandler.ValidateAndCommit(unitOfWork))
             {
                 e.Cancel = true;
             }
         }
         else if (answer == DialogResult.Cancel)
         {
             e.Cancel = true;
         }
     }
 }
コード例 #6
0
        private void Activated(object sender, DocumentCancelEventArgs e)
        {
            // Prompt for a new filename for "Save As", or a document that hasn't been saved before
            if (e.SaveAs || !e.Document.HasFile)
            {
                e.Cancel = !SaveFileAs(e.Document);
            }
            else
            {
                // Document hasn't changed, don't re-save it
                if (!e.Document.IsDirty)
                {
                    return;
                }

                // If the document already has a filename, just re-save it
                e.Cancel = !SaveFile(e.Document, null, null, PintaCore.Chrome.MainWindow);
            }
        }
コード例 #7
0
 void tabbedView_DocumentClosing(object sender, DocumentCancelEventArgs e)
 {
     TabbedView tabbedView = sender as TabbedView;
     AllowSwitchMessage allow = new AllowSwitchMessage(true, false);
     if (tabbedView != null)
     {                
         DBFormItemBase item = FindItemByDocument(tabbedView.ActiveDocument);
         if (item != null)
         {
             if (item.View is DBViewInterface)
             {
                 DBViewInterface view = item.View as DBViewInterface;
                 allow = view.DBInterface.GetAllowSwitch();
             }
         }
         if (allow.IsAllow)
             tabbedView.ActiveDocument.Form.Visible = false;
     }
     e.Cancel = true;
 }
コード例 #8
0
ファイル: FormMain.cs プロジェクト: leonSports/PlatFormLeon
 private void TabbedView_DocumentClosing(object sender, DocumentCancelEventArgs e)
 {
     e.Document.Control.Hide();
 }
コード例 #9
0
ファイル: Main2.cs プロジェクト: phanhuuthang1999/SimpleTest
        private void TabbedView_DocumentClosing(object sender, DocumentCancelEventArgs e)
        {
            var frm = (FormBase)e.Document.Form;

            CloseForm(frm);
        }
コード例 #10
0
        private void ClosingDocument(object sender, DocumentCancelEventArgs e)
        {
            IDocumentManager documentManager = IocManager.Resolve <IDocumentManager>();

            documentManager.CloseADocumentControl(e.Document.Control as IDocumentControl);
        }