Пример #1
0
        static internal XSharpColorizer GetColorizer(ITextBuffer buffer, IClassificationTypeRegistryService registry, ITextDocumentFactoryService factory)
        {
            if (hashtable == null)
            {
                hashtable = new System.Collections.Generic.Dictionary <ITextBuffer, XSharpColorizer> ();
            }
            if (hashtable.ContainsKey(buffer))
            {
                return(hashtable[buffer]);
            }
            var colorizer = new XSharpColorizer(buffer, registry, factory);

            hashtable.Add(buffer, colorizer);
            return(colorizer);
        }
Пример #2
0
        internal IClassificationTypeRegistryService ClassificationRegistry = null; // Set via MEF

        public ITagger <T> CreateTagger <T>(ITextBuffer buffer) where T : ITag
        {
            return((ITagger <T>)XSharpColorizer.GetColorizer(buffer, ClassificationRegistry, factory));
        }