Beispiel #1
0
 public IntraTextAdornmentTagger(ITextView textView, ITextBuffer textBuffer, IIntraTextAdornmentFactory <TTag> factory, string tagName)
 {
     _factory    = factory;
     _textView   = textView;
     _textBuffer = textBuffer;
     _tagName    = tagName;
 }
Beispiel #2
0
        public static ITagger <ITag> GetOrCreate(ITextView textView, ITextBuffer textBuffer, IIntraTextAdornmentFactory <TTag> factory, string tagName)
        {
            if (!textBuffer.Properties.TryGetProperty(PropertyName + "_" + tagName, out IntraTextAdornmentTagger <TTag> existingTagger))
            {
                existingTagger = new IntraTextAdornmentTagger <TTag>(textView, textBuffer, factory, tagName);
                textBuffer.Properties.AddProperty(PropertyName + "_" + tagName, existingTagger);
            }

            return(existingTagger);
        }