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

OnDocumentChanged() protected method

protected OnDocumentChanged ( TextDocument oldDocument, TextDocument newDocument ) : void
oldDocument ICSharpCode.AvalonEdit.Document.TextDocument
newDocument ICSharpCode.AvalonEdit.Document.TextDocument
return void
        protected override void OnDocumentChanged(TextDocument oldDocument, TextDocument newDocument)
        {
            if (oldDocument != null) {
                TextDocumentWeakEventManager.LineCountChanged.RemoveListener(oldDocument, this);
            }
            base.OnDocumentChanged(oldDocument, newDocument);
            if (newDocument != null) {
                TextDocumentWeakEventManager.LineCountChanged.AddListener(newDocument, this);
            }
            OnDocumentLineCountChanged();
        }