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()); }
void BeginFloating(object sender, DocumentCancelEventArgs e) { if (e.Document != null && e.Document.Caption == _frmAcceuil.Text) { e.Cancel = true; } }
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(); } }
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); }
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; } } }
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); } }
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; }
private void TabbedView_DocumentClosing(object sender, DocumentCancelEventArgs e) { e.Document.Control.Hide(); }
private void TabbedView_DocumentClosing(object sender, DocumentCancelEventArgs e) { var frm = (FormBase)e.Document.Form; CloseForm(frm); }
private void ClosingDocument(object sender, DocumentCancelEventArgs e) { IDocumentManager documentManager = IocManager.Resolve <IDocumentManager>(); documentManager.CloseADocumentControl(e.Document.Control as IDocumentControl); }