Exemplo n.º 1
0
        public TagAggregator(TagAggregatorFactoryService factory, ITextView textView, IBufferGraph bufferGraph, TagAggregatorOptions options)
        {
            this.TagAggregatorFactoryService = factory;
            this.textView           = textView;
            this.BufferGraph        = bufferGraph;
            this.options            = options;
            this.joinableTaskHelper = new JoinableTaskHelper(factory.JoinableTaskContext);

            if (textView != null)
            {
                textView.Closed += this.OnTextView_Closed;
            }

            taggers       = new Dictionary <ITextBuffer, IList <ITagger <T> > >();
            uniqueTaggers = new List <Tuple <ITagger <T>, int> >();

            if (((TagAggregatorOptions2)options).HasFlag(TagAggregatorOptions2.DeferTaggerCreation))
            {
                this.joinableTaskHelper.RunOnUIThread((Action)(this.EnsureInitialized));
            }
            else
            {
                this.Initialize();
            }

            this.BufferGraph.GraphBufferContentTypeChanged += new EventHandler <GraphBufferContentTypeChangedEventArgs>(BufferGraph_GraphBufferContentTypeChanged);
            this.BufferGraph.GraphBuffersChanged           += new EventHandler <GraphBuffersChangedEventArgs>(BufferGraph_GraphBuffersChanged);
        }
 public ITagAggregator <T> CreateTagAggregator <T>(ITextBuffer textBuffer, TagAggregatorOptions options) where T : ITag
 {
     if (textBuffer == null)
     {
         throw new ArgumentNullException(nameof(textBuffer));
     }
     return(new TextBufferTagAggregator <T>(taggerFactory, bufferGraphFactoryService.CreateBufferGraph(textBuffer), textBuffer, options));
 }
Exemplo n.º 3
0
 public ITagAggregator <T> CreateTagAggregator <T>(ITextView textView, TagAggregatorOptions options) where T : ITag
 {
     if (textView == null)
     {
         throw new ArgumentNullException(nameof(textView));
     }
     return(new TextViewTagAggregator <T>(taggerFactory, textView, options));
 }
        public ITagAggregator <T> CreateTagAggregator <T>(ITextView textView, TagAggregatorOptions options) where T : ITag
        {
            if (textView == null)
            {
                throw new ArgumentNullException(nameof(textView));
            }

            return(new TagAggregator <T>(this, textView, textView.BufferGraph, options));
        }
Exemplo n.º 5
0
        public ITagAggregator <T> CreateTagAggregator <T>(ITextBuffer textBuffer, TagAggregatorOptions options) where T : ITag
        {
            if (textBuffer == null)
            {
                throw new ArgumentNullException("textBuffer");
            }

            return(new TagAggregator <T>(this, null, this.BufferGraphFactoryService.CreateBufferGraph(textBuffer), options));
        }
Exemplo n.º 6
0
        public ITagAggregator <T> CreateTagAggregator <T>(ITextBuffer textBuffer, TagAggregatorOptions options) where T : ITag
        {
            if (typeof(T) == typeof(DeveroomTag))
            {
                var taggerProvider = new DeveroomTaggerProvider(_ideScope, null);
                taggerProvider.CreateImmediateParsingTagger = true;

                return(new StubTagAggregator <T>((ITagger <T>)taggerProvider.CreateTagger <DeveroomTag>(textBuffer), VsxStubObjects.BufferGraphFactoryService.CreateBufferGraph(textBuffer)));
            }

            throw new NotSupportedException();
        }
Exemplo n.º 7
0
 protected TagAggregatorBase(ITextBuffer textBuffer, TagAggregatorOptions options)
 {
     if (textBuffer == null)
     {
         throw new ArgumentNullException(nameof(textBuffer));
     }
     this.dispatcher             = Dispatcher.CurrentDispatcher;
     this.batchedTagsChangedList = new List <IMappingSpan>();
     this.lockObj = new object();
     TextBuffer   = textBuffer;
     TextBuffer.ContentTypeChanged += TextBuffer_ContentTypeChanged;
     this.taggers = Array.Empty <ITagger <T> >();
 }
Exemplo n.º 8
0
        public TagAggregator(TagAggregatorFactoryService factory, ITextView textView, IBufferGraph bufferGraph, TagAggregatorOptions options)
        {
            this.TagAggregatorFactoryService = factory;
            this.textView           = textView;
            this.BufferGraph        = bufferGraph;
            this.options            = options;
            this.joinableTaskHelper = new JoinableTaskHelper(factory.JoinableTaskContext);

            if (textView != null)
            {
                textView.Closed += this.OnTextView_Closed;
            }

            if (((TagAggregatorOptions2)options).HasFlag(TagAggregatorOptions2.DeferTaggerCreation))
            {
                this.joinableTaskHelper.RunOnUIThread((Action)(this.EnsureInitialized));
            }
            else
            {
                this.Initialize();
            }
        }
Exemplo n.º 9
0
 public TextViewTagAggregator(ITaggerFactory taggerFactory, ITextView textView, TagAggregatorOptions options)
     : base(textView.BufferGraph, textView.TextBuffer, options)
 {
     this.taggerFactory = taggerFactory;
     this.textView      = textView;
     textView.Closed   += TextView_Closed;
     Initialize();
 }
Exemplo n.º 10
0
 public TextBufferTagAggregator(ITaggerFactory taggerFactory, IBufferGraph bufferGraph, ITextBuffer textBuffer, TagAggregatorOptions options)
     : base(bufferGraph, textBuffer, options)
 {
     this.taggerFactory = taggerFactory;
     Initialize();
 }
Exemplo n.º 11
0
 protected TagAggregatorBase(IBufferGraph bufferGraph, ITextBuffer textBuffer, TagAggregatorOptions options)
 {
     dispatcher             = Dispatcher.CurrentDispatcher;
     batchedTagsChangedList = new List <IMappingSpan>();
     lockObj     = new object();
     BufferGraph = bufferGraph ?? throw new ArgumentNullException(nameof(bufferGraph));
     TextBuffer  = textBuffer ?? throw new ArgumentNullException(nameof(textBuffer));
     TextBuffer.ContentTypeChanged += TextBuffer_ContentTypeChanged;
     taggers = Array.Empty <ITagger <T> >();
 }