// Creates a new TextPointer instance. internal TextPointer(TextContainer textContainer, int offset, LogicalDirection direction) { SplayTreeNode node; ElementEdge edge; if (offset < 1 || offset > textContainer.InternalSymbolCount - 1) { throw new ArgumentException(SR.Get(SRID.BadDistance)); } textContainer.GetNodeAndEdgeAtOffset(offset, out node, out edge); Initialize(textContainer, (TextTreeNode)node, edge, direction, textContainer.PositionGeneration, false, false, textContainer.LayoutGeneration); }