Inheritance: INotifyPropertyChanged
		public void Undo(UndoStack stack)
		{
			for (var i = 0; i < undolist.Length; ++i)
			{
				stack.RunUndo(undolist[i]);
			}
		}
		public void Redo(UndoStack stack)
		{
			for (var i = undolist.Length - 1; i >= 0; --i)
			{
				stack.RunRedo(undolist[i]);
			}
		}
		public void Redo(UndoStack stack)
		{
			Debug.Assert(stack.state == UndoStack.StatePlayback);
			stack.RegisterAffectedDocument(document);
			stack.state = UndoStack.StatePlaybackModifyDocument;
			Redo();
			stack.state = UndoStack.StatePlayback;
		}
		/// <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();
		}