Ejemplo n.º 1
0
        public void ProcessOpen(ITextBuffer textBuffer)
        {
            if (textBuffer == null)
            {
                throw new ArgumentNullException(nameof(textBuffer));
            }

            _fileTracker.StopListening();

            _snapshotTracker.StartTracking(textBuffer);
            EditorTextBuffer                 = textBuffer;
            EditorTextContainer              = textBuffer.AsTextContainer();
            EditorTextContainer.TextChanged += TextContainer_Changed;

            _opened?.Invoke(this, EventArgs.Empty);
        }
        public void ProcessOpen(ITextBuffer textBuffer)
        {
            if (textBuffer == null)
            {
                throw new ArgumentNullException(nameof(textBuffer));
            }

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

            _snapshotTracker.StartTracking(textBuffer);
            EditorTextBuffer                 = textBuffer;
            EditorTextContainer              = textBuffer.AsTextContainer();
            EditorTextContainer.TextChanged += TextContainer_Changed;

            _opened?.Invoke(this, EventArgs.Empty);
        }