protected void OnDocumentClosed(DocumentId documentId) { this.CheckDocumentIsOpen(documentId); using (_serializationLock.DisposableWait()) { // forget any open document info ForgetAnyOpenDocumentInfo(documentId); var oldDocuments = this.CurrentDocuments; var oldDocument = oldDocuments.GetDocument(documentId); this.OnDocumentClosing(documentId); // TODO: If document is closed, but is still #include'd by another document, keep it around. var newDocuments = oldDocuments.RemoveDocument(documentId); newDocuments = this.SetCurrentDocuments(newDocuments); var newDoc = newDocuments.GetDocument(documentId); this.OnDocumentTextChanged(newDoc); DocumentClosed?.Invoke(this, new DocumentEventArgs(oldDocument)); } }
void OnDocumentClosed(Document doc) { try { var e = new DocumentEventArgs(doc); DocumentClosed?.Invoke(this, e); } catch (Exception ex) { LoggingService.LogError("Exception while closing documents", ex); } }
private void _HandleTextDocumentClosed(object sender, DidCloseTextDocumentParams e) { WorkspaceDocument document = _documents.Where(x => x.Uri.Equals(e.TextDocument.Uri)).FirstOrDefault(); if (document != null) { _documents.Remove(document); DocumentClosed?.Invoke(this, document); } }
private void WorkspaceHostDocumentClosed(DocumentId documentId) { if (documentId == DocumentId) { Dispatcher.Invoke(() => { DocumentClosed?.Invoke(this, EventArgs.Empty); // Document is closing, we assume we have been asked before to save ServiceProvider.Get <IEditorDialogService>().AssetEditorsManager.CloseAssetEditorWindow(Asset, false); }); } }
protected virtual void OnDocumentClosed(DocumentClosedEventArgs e) { DocumentClosed?.Invoke(this, e); }
/// <summary> /// Invokes handlers of the <see cref="DocumentClosed"/> event. /// </summary> /// <param name="document">The closed document.</param> protected void NotifyDocumentClosed(IDocument document) { DocumentClosed?.Invoke(this, new DocumentWindowEventArgs(document)); }