public void SaveAll() { // Make a copy of the list, since it may change during save Document[] docs = new Document [Documents.Count]; Documents.CopyTo(docs, 0); foreach (Document doc in docs) { doc.Save(); } }
public void SaveAll() { ITimeTracker tt = Counters.SaveAllTimer.BeginTiming(); try { // Make a copy of the list, since it may change during save Document[] docs = new Document [Documents.Count]; Documents.CopyTo(docs, 0); foreach (Document doc in docs) { doc.Save(); } } finally { tt.End(); } }
public void CloseAllDocuments(bool leaveActiveDocumentOpen) { Document[] docs = new Document [Documents.Count]; Documents.CopyTo(docs, 0); // The active document is the last one to close. // It avoids firing too many ActiveDocumentChanged events. foreach (Document doc in docs) { if (doc != ActiveDocument) { doc.Close(); } } if (!leaveActiveDocumentOpen && ActiveDocument != null) { ActiveDocument.Close(); } }
public void InitPanels(WabbitcodeStatusBar statusBar) { StatusBar = new WabbitcodeStatusBarService(this, statusBar); //Init Normal Panels LabelList = new LabelList(); LabelList.Show(DockManager, AnchorStyle.Right); ProjectViewer = new ProjectViewer(); ProjectViewer.Show(DockManager, AnchorStyle.Left); OutputWindow = new OutputWindow(); OutputWindow.Show(DockManager, AnchorStyle.Bottom); ErrorList = new ErrorList(); ErrorList.Show(DockManager, AnchorStyle.Bottom); if (File.Exists(pathsService.DockConfig)) { try { DockManager.RestoreLayout(pathsService.DockConfig); } catch (Exception) { } } IDocumentService documentService = ServiceFactory.Instance.GetServiceInstance <DocumentService>(); try { DocumentContent[] docs = new DocumentContent[Documents.Count]; Documents.CopyTo(docs, 0); foreach (Editor doc in docs) { documentService.OpenDocument(doc); } } catch (Exception ex) { ShowError("Error restoring documents", ex); } }
/// <summary> /// Copies the documents in the library to an array, starting at the supplied index. /// </summary> /// <param name="array">The array to copy the items into.</param> /// <param name="arrayIndex">The index within the array to place the copied documents at.</param> public void CopyTo(SharePointDocument[] array, int arrayIndex) { Documents.CopyTo(array, arrayIndex); }