public void Unsubscribe() { _importDocumentManager.OnUnsubscribed(this); _projectManager.Changed -= ProjectManager_Changed; _workspaceEditorSettings.Changed -= EditorSettingsManager_Changed; _importDocumentManager.Changed -= Import_Changed; // Detached from project. _isSupportedProject = false; _project = null; OnContextChanged(project: null, kind: ContextChangeKind.ProjectChanged); }
public void Unsubscribe() { _foregroundDispatcher.AssertForegroundThread(); if (_subscribeCount == 0 || _subscribeCount-- > 1) { return; } _importDocumentManager.OnUnsubscribed(this); _projectManager.Changed -= ProjectManager_Changed; _workspaceEditorSettings.Changed -= EditorSettingsManager_Changed; _importDocumentManager.Changed -= Import_Changed; // Detached from project. _isSupportedProject = false; _projectSnapshot = null; OnContextChanged(kind: ContextChangeKind.ProjectChanged); }