Ejemplo n.º 1
0
 private void DocumentManager_DockControlClosing(object sender, TD.SandDock.DockControlClosingEventArgs e)
 {
     if (e.DockControl is TabbedDocument && this.DocumentsClosing != null)
     {
         ClosingDocumentsEventArgs ce = new ClosingDocumentsEventArgs(new TabbedDocument[] { (TabbedDocument)e.DockControl });
         this.DocumentsClosing(this, ce);
         e.Cancel = ce.Cancel;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Пытается закрыть указанные документы
 /// </summary>
 /// <returns>true, если документы были закрыты</returns>
 public bool CloseDocuments(TabbedDocument[] documents)
 {
     if (this.DocumentsClosing != null)
     {
         ClosingDocumentsEventArgs e = new ClosingDocumentsEventArgs(documents);
         this.DocumentsClosing(this, e);
         if (e.Cancel)
         {
             return(false);
         }
     }
     foreach (TabbedDocument doc in documents)
     {
         doc.Close();
     }
     return(true);
 }