예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XSharpClassifier"/> class.
 /// </summary>
 /// <param name="registry">Classification registry.</param>
 internal XSharpClassifier(ITextBuffer buffer, IClassificationTypeRegistryService registry, ITextDocumentFactoryService factory)
 {
     this.buffer = buffer;
     
     txtdocfactory = factory;
     xsTagger = new XSharpTagger(registry);
     tags = new List<ClassificationSpan>();
     //
     xsharpKeywordType = registry.GetClassificationType(ColorizerConstants.XSharpKeywordFormat);
     xsharpIdentifierType = registry.GetClassificationType(ColorizerConstants.XSharpIdentifierFormat);
     xsharpCommentType = registry.GetClassificationType(ColorizerConstants.XSharpCommentFormat);
     xsharpOperatorType = registry.GetClassificationType(ColorizerConstants.XSharpOperatorFormat);
     xsharpConstantType = registry.GetClassificationType(ColorizerConstants.XSharpConstantFormat);
     xsharpBraceOpenType = registry.GetClassificationType(ColorizerConstants.XSharpBraceOpenFormat);
     xsharpBraceCloseType = registry.GetClassificationType(ColorizerConstants.XSharpBraceCloseFormat);
     xsharpRegionStart = registry.GetClassificationType(ColorizerConstants.XSharpRegionStartFormat);
     xsharpRegionStop = registry.GetClassificationType(ColorizerConstants.XSharpRegionStopFormat);
     //
     Parse(buffer.CurrentSnapshot);
     isBusy = false;
 }
예제 #2
0
        private XSharpColorizer(ITextBuffer buffer, IClassificationTypeRegistryService registry, ITextDocumentFactoryService factory)
        {
            this.Buffer = buffer;
            //this.Snapshot = buffer.CurrentSnapshot;
            txtdocfactory = factory;
            xsTagger      = new XSharpTagger(registry);

            tags = new List <ITagSpan <IClassificationTag> >();
            //
            xsharpKeywordType    = registry.GetClassificationType(ColorizerConstants.XSharpKeywordFormat);
            xsharpIdentifierType = registry.GetClassificationType(ColorizerConstants.XSharpIdentifierFormat);
            xsharpCommentType    = registry.GetClassificationType(ColorizerConstants.XSharpCommentFormat);
            xsharpOperatorType   = registry.GetClassificationType(ColorizerConstants.XSharpOperatorFormat);
            xsharpConstantType   = registry.GetClassificationType(ColorizerConstants.XSharpConstantFormat);
            xsharpBraceOpenType  = registry.GetClassificationType(ColorizerConstants.XSharpBraceOpenFormat);
            xsharpBraceCloseType = registry.GetClassificationType(ColorizerConstants.XSharpBraceCloseFormat);
            xsharpRegionStart    = registry.GetClassificationType(ColorizerConstants.XSharpRegionStartFormat);
            xsharpRegionStop     = registry.GetClassificationType(ColorizerConstants.XSharpRegionStopFormat);
            this.Buffer.Changed += OnBufferChanged;
            //
            Colorize();
        }