#pragma warning restore 67 protected CommentTagger(IClassificationTypeRegistryService registry, ITagAggregator <IClassificationTag> aggregator, TaggerResult tags) { if (__CommentClassifications == null) { var t = typeof(CommentStyleTypes); var styleNames = Enum.GetNames(t); __CommentClassifications = new ClassificationTag[styleNames.Length]; foreach (var styleName in styleNames) { var f = t.GetField(styleName); var d = f.GetCustomAttribute <ClassificationTypeAttribute>(); if (d == null) { continue; } var ct = registry.GetClassificationType(d.ClassificationTypeNames); __CommentClassifications[(int)f.GetValue(null)] = new ClassificationTag(ct); __CommentClasses[ct] = true; } } _Aggregator = aggregator; _Tags = tags; _Aggregator.TagsChanged += AggregatorBatchedTagsChanged; }
protected CachedTaggerBase(ITextView textView) { _TextView = textView; _Tags = textView.Properties.GetOrCreateSingletonProperty(() => new TaggerResult()); }
public static CommentTagger Create(IClassificationTypeRegistryService registry, ITagAggregator <IClassificationTag> aggregator, TaggerResult tags, ITextBuffer textBuffer) { switch (GetCodeType(textBuffer)) { case CodeType.CSharp: return(new CSharpCommentTagger(registry, aggregator, tags)); case CodeType.Markup: return(new MarkupCommentTagger(registry, aggregator, tags)); case CodeType.C: return(new CCommentTagger(registry, aggregator, tags)); case CodeType.Css: return(new CssCommentTagger(registry, aggregator, tags)); case CodeType.Js: return(new JsCommentTagger(registry, aggregator, tags)); } return(null); }
public MarkupCommentTagger(IClassificationTypeRegistryService registry, ITagAggregator <IClassificationTag> aggregator, TaggerResult tags) : base(registry, aggregator, tags) { }
public CSharpCommentTagger(IClassificationTypeRegistryService registry, ITagAggregator <IClassificationTag> aggregator, TaggerResult tags) : base(registry, aggregator, tags) { _PreprocessorKeyword = registry.GetClassificationType("preprocessor keyword"); }