MS\Internal\PtsHost\BaseParagraph.cs (5)
182int openEdgeCp = TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeStart);
253return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.AfterStart);
257return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeStart);
274return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeEnd);
278return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.AfterEnd);
System\Windows\Documents\TextContainer.cs (65)
471ElementEdge edge;
486ElementEdge edge;
510ElementEdge edge;
622ElementEdge edge;
635edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd;
646edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd;
854Invariant.Assert((position.Edge == ElementEdge.AfterEnd && position.Node.GetPreviousNode() is TextTreeTextNode && position.Node.GetPreviousNode().SymbolCount > 0) ||
855(position.Edge == ElementEdge.BeforeStart && position.Node.GetNextNode() is TextTreeTextNode && position.Node.GetNextNode().SymbolCount > 0));
873if (position.Edge == ElementEdge.BeforeStart || position.Edge == ElementEdge.BeforeEnd)
1118startEdgePosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart);
1126endEdgePosition = new TextPointer(this, elementNode, ElementEdge.BeforeEnd);
1213insertPosition = new TextPointer(this, objectNode, ElementEdge.BeforeStart);
1280internal void GetNodeAndEdgeAtOffset(int offset, out SplayTreeNode node, out ElementEdge edge)
1287internal void GetNodeAndEdgeAtOffset(int offset, bool splitNode, out SplayTreeNode node, out ElementEdge edge)
1322edge = ElementEdge.BeforeStart;
1330edge = ElementEdge.AfterStart;
1335edge = ElementEdge.BeforeEnd;
1341edge = ElementEdge.AfterEnd;
1355node = ((TextTreeTextNode)node).Split(offset - nodeOffset, ElementEdge.AfterEnd);
1357edge = ElementEdge.BeforeStart;
1379internal void GetNodeAndEdgeAtCharOffset(int charOffset, out TextTreeNode node, out ElementEdge edge)
1393edge = ElementEdge.BeforeStart;
1420edge = ElementEdge.BeforeStart;
1425edge = ElementEdge.AfterStart;
1434edge = ElementEdge.BeforeStart;
1440edge = ElementEdge.AfterEnd;
1453node = ((TextTreeTextNode)node).Split(charOffset - nodeCharOffset, ElementEdge.AfterEnd);
1454edge = ElementEdge.BeforeStart;
1640startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward);
1671endPosition = new TextPointer(this, _rootNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
2153private SplayTreeNode AdjustForZeroWidthNode(SplayTreeNode node, ElementEdge edge)
2199else if (edge == ElementEdge.BeforeStart)
2304ElementEdge previousEdge;
2306ElementEdge nextEdge;
2335previousEdge = ElementEdge.AfterEnd;
2340previousEdge = ElementEdge.AfterStart;
2345nextEdge = ElementEdge.BeforeStart;
2350nextEdge = ElementEdge.BeforeEnd;
2530private void AdjustRefCountsForContentDelete(ref TextTreeNode previousNode, ElementEdge previousEdge,
2531ref TextTreeNode nextNode, ElementEdge nextEdge,
2585private void AdjustRefCountsForShallowDelete(ref TextTreeNode previousNode, ElementEdge previousEdge,
2586ref TextTreeNode nextNode,ElementEdge nextEdge,
2596firstContainedNode = firstContainedNode.IncrementReferenceCount(ElementEdge.BeforeStart, extractedElementNode.BeforeStartReferenceCount);
2605lastContainedNode = lastContainedNode.IncrementReferenceCount(ElementEdge.AfterEnd, extractedElementNode.AfterEndReferenceCount);
2634case ElementEdge.BeforeStart:
2638case ElementEdge.AfterStart:
2642case ElementEdge.BeforeEnd:
2648case ElementEdge.AfterEnd:
2656case ElementEdge.BeforeStart:
2660case ElementEdge.AfterStart:
2666case ElementEdge.BeforeEnd:
2670case ElementEdge.AfterEnd:
2793startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward);
2798endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
2975ElementEdge previousEdge;
2977ElementEdge nextEdge;
2987previousEdge = ElementEdge.AfterEnd;
2991previousEdge = ElementEdge.AfterStart;
2994nextEdge = ElementEdge.BeforeStart;
2998nextEdge = ElementEdge.BeforeEnd;
3436TextPointer startEdgePosition = new TextPointer(this, node, ElementEdge.BeforeStart);
3448TextPointer startEdgePosition = new TextPointer(this, node, ElementEdge.BeforeStart);
System\Windows\Documents\TextElement.cs (9)
303TextPointer contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward);
306TextPointer contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
329elementStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
362contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward);
395contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
436elementEnd = new TextPointer(tree, _textElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
1009beforeStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
1516tree.InsertTextInternal(new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd), textData);
1550position = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd);
System\Windows\Documents\TextPointer.cs (143)
291ElementEdge edge;
304internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge)
310internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection direction)
1816internal static DependencyObject GetAdjacentElement(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
1896ElementEdge edge;
1975ElementEdge edge;
2189ElementEdge edge;
2206case ElementEdge.BeforeStart:
2211edge = ElementEdge.AfterEnd;
2218edge = ElementEdge.AfterStart;
2222case ElementEdge.AfterStart:
2227edge = ElementEdge.BeforeStart;
2233edge = ElementEdge.BeforeEnd;
2238case ElementEdge.BeforeEnd:
2243edge = ElementEdge.AfterEnd;
2249edge = ElementEdge.AfterStart;
2253case ElementEdge.AfterEnd:
2258edge = ElementEdge.BeforeStart;
2265edge = ElementEdge.BeforeEnd;
2617void ITextPointer.MoveToElementEdge(ElementEdge edge)
2622internal void MoveToElementEdge(ElementEdge edge)
2822internal static TextTreeTextNode GetAdjacentTextNodeSibling(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
2850internal static TextTreeNode GetAdjacentSiblingNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
2858case ElementEdge.BeforeStart:
2862case ElementEdge.AfterStart:
2866case ElementEdge.BeforeEnd:
2871case ElementEdge.AfterEnd:
2880case ElementEdge.BeforeStart:
2884case ElementEdge.AfterStart:
2889case ElementEdge.BeforeEnd:
2893case ElementEdge.AfterEnd:
2911internal static int GetSymbolOffset(TextContainer tree, TextTreeNode node, ElementEdge edge)
2917case ElementEdge.BeforeStart:
2921case ElementEdge.AfterStart:
2925case ElementEdge.BeforeEnd:
2929case ElementEdge.AfterEnd:
2959ElementEdge edge;
3012if (edge == ElementEdge.BeforeStart && fixup.FirstContainedNode != null)
3020Invariant.Assert(edge == ElementEdge.BeforeStart, "edge BeforeStart is expected");
3030if (edge == ElementEdge.AfterEnd && fixup.LastContainedNode != null)
3038Invariant.Assert(edge == ElementEdge.AfterEnd, "edge AfterEnd is expected");
3066internal static TextTreeNode GetScopingNode(TextTreeNode node, ElementEdge edge)
3072case ElementEdge.BeforeStart:
3073case ElementEdge.AfterEnd:
3077case ElementEdge.AfterStart:
3078case ElementEdge.BeforeEnd:
3093internal bool GetNextNodeAndEdge(out TextTreeNode node, out ElementEdge edge)
3103internal static bool GetNextNodeAndEdge(TextTreeNode sourceNode, ElementEdge sourceEdge, bool plainTextOnly, out TextTreeNode node, out ElementEdge edge)
3128case ElementEdge.BeforeStart:
3138edge = ElementEdge.BeforeEnd;
3144edge = ElementEdge.BeforeEnd;
3145goto case ElementEdge.BeforeEnd;
3149case ElementEdge.AfterStart:
3156edge = ElementEdge.AfterStart;
3162edge = ElementEdge.AfterEnd;
3169edge = ElementEdge.AfterEnd;
3178case ElementEdge.BeforeEnd:
3184edge = ElementEdge.BeforeStart;
3193case ElementEdge.AfterEnd:
3203edge = ElementEdge.AfterStart;
3239if (edge == ElementEdge.BeforeStart)
3241edge = ElementEdge.BeforeEnd;
3247Invariant.Assert(edge == ElementEdge.AfterEnd);
3263internal bool GetPreviousNodeAndEdge(out TextTreeNode node, out ElementEdge edge)
3273internal static bool GetPreviousNodeAndEdge(TextTreeNode sourceNode, ElementEdge sourceEdge, bool plainTextOnly, out TextTreeNode node, out ElementEdge edge)
3297case ElementEdge.BeforeStart:
3305edge = ElementEdge.BeforeEnd;
3326case ElementEdge.AfterStart:
3333edge = ElementEdge.AfterEnd;
3342case ElementEdge.BeforeEnd:
3349edge = ElementEdge.BeforeEnd;
3355edge = ElementEdge.BeforeStart;
3362edge = ElementEdge.BeforeStart;
3371case ElementEdge.AfterEnd:
3381edge = ElementEdge.AfterStart;
3387edge = ElementEdge.AfterStart;
3388goto case ElementEdge.AfterStart;
3408if (edge == ElementEdge.AfterEnd)
3410edge = ElementEdge.AfterStart;
3416Invariant.Assert(edge == ElementEdge.BeforeStart);
3432internal static TextPointerContext GetPointerContextForward(TextTreeNode node, ElementEdge edge)
3440case ElementEdge.BeforeStart:
3444case ElementEdge.AfterStart:
3452goto case ElementEdge.BeforeEnd;
3456case ElementEdge.BeforeEnd:
3462case ElementEdge.AfterEnd:
3486internal static TextPointerContext GetPointerContextBackward(TextTreeNode node, ElementEdge edge)
3494case ElementEdge.BeforeStart:
3508case ElementEdge.AfterStart:
3514case ElementEdge.BeforeEnd:
3522goto case ElementEdge.AfterStart;
3526case ElementEdge.AfterEnd:
3751case ElementEdge.BeforeStart:
3755case ElementEdge.AfterStart:
3765case ElementEdge.BeforeEnd:
3766case ElementEdge.AfterEnd:
3855internal ElementEdge Edge
3859return (ElementEdge)(_flags & (uint)Flags.EdgeMask);
3896ElementEdge edge;
3930private void Initialize(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection gravity, uint generation,
3967private TextTreeNode AdjustRefCounts(TextTreeNode newNode, ElementEdge newNodeEdge, TextTreeNode oldNode, ElementEdge oldNodeEdge)
3990private static void RepositionForGravity(ref TextTreeNode node, ref ElementEdge edge, LogicalDirection gravity)
3993ElementEdge newEdge;
4000case ElementEdge.BeforeStart:
4004newEdge = ElementEdge.AfterEnd;
4008newEdge = ElementEdge.AfterStart;
4013case ElementEdge.AfterStart:
4017newEdge = ElementEdge.BeforeStart;
4021newEdge = ElementEdge.BeforeEnd;
4026case ElementEdge.BeforeEnd:
4030newEdge = ElementEdge.AfterEnd;
4034newEdge = ElementEdge.AfterStart;
4039case ElementEdge.AfterEnd:
4043newEdge = ElementEdge.BeforeStart;
4047newEdge = ElementEdge.BeforeEnd;
4060return (this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd) ? LogicalDirection.Forward : LogicalDirection.Backward;
4078internal static TextTreeNode GetAdjacentNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
4087if (edge == ElementEdge.AfterStart || edge == ElementEdge.BeforeEnd)
4102private void MoveToNode(TextContainer tree, TextTreeNode node, ElementEdge edge)
4144Invariant.Assert(this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd, "Bad position edge/gravity pair! (1)");
4149Invariant.Assert(this.Edge == ElementEdge.AfterStart || this.Edge == ElementEdge.AfterEnd, "Bad position edge/gravity pair! (2)");
4155Invariant.Assert(this.Edge != ElementEdge.BeforeStart && this.Edge != ElementEdge.AfterEnd, "Position at outer edge of root!");
4160Invariant.Assert(this.Edge != ElementEdge.AfterStart && this.Edge != ElementEdge.BeforeEnd, "Position at inner leaf node edge!");
4259private void SetNodeAndEdge(TextTreeNode node, ElementEdge edge)
4261Invariant.Assert(edge == ElementEdge.BeforeStart ||
4262edge == ElementEdge.AfterStart ||
4263edge == ElementEdge.BeforeEnd ||
4264edge == ElementEdge.AfterEnd);
4285ElementEdge edge = (ElementEdge)(_flags & (uint)Flags.EdgeMask);
4287Invariant.Assert(edge == ElementEdge.BeforeStart ||
4288edge == ElementEdge.AfterStart ||
4289edge == ElementEdge.BeforeEnd ||
4290edge == ElementEdge.AfterEnd);