DocumentLine IList <DocumentLine> .this[int index] { get { document.VerifyAccess(); return(GetByNumber(1 + index)); } set { throw new NotSupportedException(); } }
/// <summary> /// Creates a new FoldingManager instance. /// </summary> public FoldingManager(TextDocument document) { if (document == null) throw new ArgumentNullException(nameof(document)); this.document = document; foldings = new TextSegmentCollection<FoldingSection>(); document.VerifyAccess(); TextDocumentWeakEventManager.Changed.AddListener(document, this); }
/// <summary> /// Creates a new TextSegmentCollection that updates the offsets automatically. /// </summary> /// <param name="textDocument">The document to which the text segments /// that will be added to the tree belong. When the document changes, the /// position of the text segments will be updated accordingly.</param> public TextSegmentCollection(TextDocument textDocument) { if (textDocument == null) throw new ArgumentNullException("textDocument"); textDocument.VerifyAccess(); isConnectedToDocument = true; TextDocumentWeakEventManager.Changed.AddListener(textDocument, this); }
public AvalonEditTextDocument(ICSharpCode.AvalonEdit.Document.TextDocument avalonEditTextDocument, Encoding encodingForAlphanumericLiterals, ColumnsLayout columnsLayout) { // Document source name and text format Source = new TextSourceInfo(_avalonEditTextDocument.FileName, encodingForAlphanumericLiterals, columnsLayout); _avalonEditTextDocument = avalonEditTextDocument; // Listen to all line changes in the editor _avalonEditTextDocument.VerifyAccess(); _weakLineTracker = WeakLineTracker.Register(_avalonEditTextDocument, this); }
public AvalonEditTextDocument(ICSharpCode.AvalonEdit.Document.TextDocument avalonEditTextDocument, Encoding encodingForAlphanumericLiterals, ColumnsLayout columnsLayout) { // Document source name and text format Source = new TextSourceInfo(_avalonEditTextDocument.FileName, encodingForAlphanumericLiterals, columnsLayout); _avalonEditTextDocument = avalonEditTextDocument; // Listen to all line changes in the editor _avalonEditTextDocument.VerifyAccess(); _weakLineTracker = WeakLineTracker.Register(_avalonEditTextDocument, this); }
/// <summary> /// Creates a new FoldingManager instance. /// </summary> public FoldingManager(TextView textView, TextDocument document) { if (textView == null) throw new ArgumentNullException("textView"); if (document == null) throw new ArgumentNullException("document"); this.textView = textView; this.document = document; this.foldings = new TextSegmentCollection<FoldingSection>(); document.VerifyAccess(); TextDocumentWeakEventManager.Changed.AddListener(document, this); }