void UpdateCurrentDocumentController() { var activeDocument = GetActiveDocument(); if (activeDocument == null) { Debug.WriteLine("UpdateCurrentDocumentController(): No active Document."); currentDocumentController = null; addinModule.UpdateState(null); return; } Debug.WriteLine("WindowCount=" + wordApp.Application.Windows.Count); Debug.WriteLine("UpdateCurrentDocumentController(): Updating current"); currentDocumentController = GetControllerForDocument(activeDocument); currentDocumentController.Activate(); currentDocumentController.Document.Application.ScreenUpdating = false; try { addinModule.SetSelectedStyle(currentDocumentController.Style ?? DefaultStyle); addinModule.UpdateState(new SelectionManager(currentDocumentController)); } finally { currentDocumentController.Document.Application.ScreenUpdating = true; } }
public CitationInserter(DocumentController documentController) { this.documentController = documentController; citeProc = documentController.CiteProc; document = documentController.document; inlineCitationCache = documentController.inlineCitationCache; citationList = new List <JSCitationIDAndIndexPair>(documentController.document.Fields.Count); }
public CitationInserter(DocumentController documentController) { this.documentController = documentController; citeProc = documentController.CiteProc; document = documentController.document; inlineCitationCache = documentController.inlineCitationCache; citationList = new List<JSCitationIDAndIndexPair>(documentController.document.Fields.Count); }
DocumentController GetControllerForDocument(Document document) { if (document == null) { throw new ArgumentNullException("document"); } DocumentController result; if (!documentControllers.TryGetValue(document, out result)) { //Debug.WriteLine("GetControllerForDocument(): No controller found for document - creating new."); result = new DocumentController(this, document); documentControllers[document] = result; } //Debug.WriteLine("GetControllerForDocument(): Returning controller for document."); return(result); }
DocumentController GetControllerForDocument(Document document) { if (document == null) throw new ArgumentNullException("document"); DocumentController result; if (!documentControllers.TryGetValue(document, out result)) { //Debug.WriteLine("GetControllerForDocument(): No controller found for document - creating new."); result = new DocumentController(this, document); documentControllers[document] = result; } //Debug.WriteLine("GetControllerForDocument(): Returning controller for document."); return result; }
public SelectionManager(DocumentController documentController) { this.documentController = documentController; range = documentController.Document.Application.Selection.Range.Duplicate; }