ICSharpCode.AvalonEdit.Editing.LineNumberMargin.OnTextViewChanged C# (CSharp) Method

OnTextViewChanged() protected method

protected OnTextViewChanged ( TextView oldTextView, TextView newTextView ) : void
oldTextView TextView
newTextView TextView
return void
        protected override void OnTextViewChanged(TextView oldTextView, TextView newTextView)
        {
            if (oldTextView != null) {
                oldTextView.VisualLinesChanged -= TextViewVisualLinesChanged;
            }
            base.OnTextViewChanged(oldTextView, newTextView);
            if (newTextView != null) {
                newTextView.VisualLinesChanged += TextViewVisualLinesChanged;

                // find the text area belonging to the new text view
                textArea = newTextView.Services.GetService(typeof(TextArea)) as TextArea;
            } else {
                textArea = null;
            }
            InvalidateVisual();
        }