public void Dispose()
        {
            _joinableTaskContext.AssertUIThread();

            if (!_disposed)
            {
                _fileTracker.Changed -= ChangeTracker_Changed;

                _ = _projectSnapshotManagerDispatcher.RunOnDispatcherThreadAsync(
                    () => _fileTracker.StopListening(), CancellationToken.None);

                if (EditorTextBuffer != null)
                {
                    _snapshotTracker.StopTracking(EditorTextBuffer);
                    EditorTextBuffer = null;
                }

                if (EditorTextContainer != null)
                {
                    EditorTextContainer.TextChanged -= TextContainer_Changed;
                    EditorTextContainer              = null;
                }

                _documentManager.RemoveDocument(this);

                _disposed = true;
            }
        }
Exemple #2
0
        public void Dispose()
        {
            if (!_disposed)
            {
                _fileTracker.Changed -= ChangeTracker_Changed;
                _fileTracker.StopListening();

                EditorTextContainer.TextChanged -= TextContainer_Changed;
                EditorTextContainer              = null;
                EditorTextBuffer = null;

                _documentManager.RemoveDocument(this);

                _disposed = true;
            }
        }