상속: TextAddin.Controls.Layer, ILineTracker, IServiceProvider
예제 #1
0
파일: TextView.cs 프로젝트: chartly/flood
 public TextView(Control parent, TextDocument textDocument)
     : base(parent)
 {
     Dock = Pos.Fill;
     TextLayer = new TextLayer(this, textDocument);
     CarretLayer = new CarretLayer(this);
 }
예제 #2
0
        private void Init()
        {
            DeleteAllChildren();

            phase = LifetimePhase.Generating;
            TextLayer.InitVisualLine(this);
        }
예제 #3
0
        public VisualLine(TextLayer parent, DocumentLine documentLine) : base(parent)
        {
            DocumentLine = documentLine;
            elements     = new List <VisualLineElement>();

            Init();

            documentLine.TextChanged += OnTextChanged;
        }
예제 #4
0
        public VisualLine(TextLayer parent, DocumentLine documentLine)
            : base(parent)
        {
            DocumentLine = documentLine;
            elements = new List<VisualLineElement>();

            Init();

            documentLine.TextChanged += OnTextChanged;
        }
예제 #5
0
 /// <inheritdoc/>
 protected override void OnRemoveFromTextLayer(TextLayer textLayer)
 {
     base.OnRemoveFromTextLayer(textLayer);
     textLayer.Services.RemoveService(typeof(IHighlighter));
     textLayer.Services.RemoveService(typeof(DocumentHighlighter));
 }
예제 #6
0
 /// <inheritdoc/>
 protected override void OnAddToTextLayer(TextLayer textLayer)
 {
     base.OnAddToTextLayer(textLayer);
     OnDocumentChanged(textLayer);
 }
예제 #7
0
 /// <summary>
 /// Creates the IHighlighter instance for the specified text document.
 /// </summary>
 protected virtual IHighlighter CreateHighlighter(TextLayer textLayer, TextDocument document)
 {
     return new TextLayerDocumentHighlighter(this, textLayer, ruleSet);
 }
예제 #8
0
 public TextLayerDocumentHighlighter(HighlightingColorizer colorizer, TextLayer textLayer, HighlightingRuleSet baseRuleSet)
     : base(textLayer.Document, baseRuleSet)
 {
     Debug.Assert(colorizer != null);
     Debug.Assert(textLayer != null);
     this.colorizer = colorizer;
     this.textLayer = textLayer;
 }
예제 #9
0
        void OnDocumentChanged(TextLayer textLayer)
        {
            // remove existing highlighter, if any exists
            textLayer.Services.RemoveService(typeof(IHighlighter));
            textLayer.Services.RemoveService(typeof(DocumentHighlighter));

            TextDocument document = textLayer.Document;
            if (document != null) {
                IHighlighter highlighter = CreateHighlighter(textLayer, document);
                textLayer.Services.AddService(typeof(IHighlighter), highlighter);
                // for backward compatiblity, we're registering using both the interface and concrete types
                if (highlighter is DocumentHighlighter)
                    textLayer.Services.AddService(typeof(DocumentHighlighter), highlighter);
            }
        }
예제 #10
0
 public TextView(Control parent, TextDocument textDocument) : base(parent)
 {
     Dock        = Pos.Fill;
     TextLayer   = new TextLayer(this, textDocument);
     CarretLayer = new CarretLayer(this);
 }
예제 #11
0
 void ITextLayerConnect.RemoveFromTextLayer(TextLayer textLayer)
 {
     OnRemoveFromTextLayer(textLayer);
 }
예제 #12
0
 void ITextLayerConnect.AddToTextLayer(TextLayer textLayer)
 {
     OnAddToTextLayer(textLayer);
 }
예제 #13
0
 /// <summary>
 /// Called when removed from a text view.
 /// </summary>
 protected virtual void OnRemoveFromTextLayer(TextLayer textLayer)
 {
 }
예제 #14
0
 /// <summary>
 /// Called when added to a text view.
 /// </summary>
 protected virtual void OnAddToTextLayer(TextLayer textLayer)
 {
 }