/// <summary> /// Create an empty text document. /// </summary> public TextDocument() { lineTree = new DocumentLineTree(this); lineManager = new LineManager(textBuffer, lineTree, this); lineTrackers.CollectionChanged += delegate { lineManager.lineTrackers = lineTrackers.ToArray(); }; anchorTree = new TextAnchorTree(this); undoStack = new UndoStack(); undoStack.AttachToDocument(this); FireChangeEvents(); }
/// <summary> /// Create a new text document with the specified initial text. /// </summary> public TextDocument(IEnumerable<char> initialText) { if (initialText == null) throw new ArgumentNullException("initialText"); rope = new Rope<char>(initialText); lineTree = new DocumentLineTree(this); lineManager = new LineManager(lineTree, this); lineTrackers.CollectionChanged += delegate { lineManager.UpdateListOfLineTrackers(); }; anchorTree = new TextAnchorTree(this); undoStack = new UndoStack(); FireChangeEvents(); }
/// <summary> /// Create a new text document with the specified initial text. /// </summary> public TextDocument(IEnumerable<char> initialText) { if (initialText == null) throw new ArgumentNullException("initialText"); rope = new Rope<char>(initialText); lineTree = new DocumentLineTree(this); lineManager = new LineManager(lineTree, this); lineTrackers.CollectionChanged += delegate { lineManager.UpdateListOfLineTrackers(); }; anchorTree = new TextAnchorTree(this); undoStack = new UndoStack(); FireChangeEvents(); }