Example #1
0
 internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
 {
     this.heightTree = heightTree;
     this.start      = start;
     this.end        = end;
                 #if DEBUG
     unchecked {
         this.ID = " #" + (nextId++);
     }
                 #endif
 }
Example #2
0
 internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
 {
     this.heightTree = heightTree;
     this.start = start;
     this.end = end;
     #if DEBUG
     unchecked {
         this.ID = " #" + (nextId++);
     }
     #endif
 }
Example #3
0
        public TextLayer(TextView parent, TextDocument textDocument)
            : base(parent)
        {
            Document = textDocument;

            elementGenerators = new ObserveAddRemoveCollection<VisualLineElementGenerator>(ElementGenerator_Added, ElementGenerator_Removed);
            lineTransformers = new ObserveAddRemoveCollection<IVisualLineTransformer>(LineTransformer_Added, LineTransformer_Removed);

            heightTree = new HeightTree(textDocument, 16); //TODO Skin.DefaultFont.Size
            lines = new Dictionary<DocumentLine, VisualLine>();

            GlobalTextRunProperties = new TextRunProperties { Foreground = Color.Black};

            lineTransformers = new ObserveAddRemoveCollection<IVisualLineTransformer>(LineTransformer_Added,LineTransformer_Removed);

            HighlightingDefinition = HighlightingManager.DefaultHighlightingManager.Instance.GetDefinition("C#");

            var colorizer = new HighlightingColorizer(highlightingDefinition.MainRuleSet);
            lineTransformers.Add(colorizer);

            weakLineTracker = WeakLineTracker.Register(textDocument, this);

            RebuildDocument();
        }