コード例 #1
0
#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;
        }
コード例 #2
0
ファイル: CommentTagger.cs プロジェクト: molongwudi/Codist
 public MarkupCommentTagger(IClassificationTypeRegistryService registry, ITagAggregator <IClassificationTag> aggregator, TaggerResult tags) : base(registry, aggregator, tags)
 {
 }
コード例 #3
0
ファイル: CommentTagger.cs プロジェクト: molongwudi/Codist
            public static CommentTagger Create(IClassificationTypeRegistryService registry, ITagAggregator <IClassificationTag> aggregator, TaggerResult tags, CodeType type)
            {
                switch (type)
                {
                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);
            }
コード例 #4
0
 public CSharpCommentTagger(IClassificationTypeRegistryService registry, ITagAggregator <IClassificationTag> aggregator, TaggerResult tags) : base(registry, aggregator, tags)
 {
     _PreprocessorKeyword = registry.GetClassificationType("preprocessor keyword");
 }
コード例 #5
0
 protected CachedTaggerBase(ITextView textView)
 {
     _TextView = textView;
     _Tags     = textView.Properties.GetOrCreateSingletonProperty(() => new TaggerResult());
 }