src\Framework\MS\Internal\PtsHost\BaseParagraph.cs (5)
186int openEdgeCp = TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeStart);
257return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.AfterStart);
261return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeStart);
278return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeEnd);
282return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.AfterEnd);
src\Framework\System\Windows\Documents\TextContainer.cs (65)
486ElementEdge edge;
501ElementEdge edge;
525ElementEdge edge;
637ElementEdge edge;
650edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd;
661edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd;
869Invariant.Assert((position.Edge == ElementEdge.AfterEnd && position.Node.GetPreviousNode() is TextTreeTextNode && position.Node.GetPreviousNode().SymbolCount > 0) ||
870(position.Edge == ElementEdge.BeforeStart && position.Node.GetNextNode() is TextTreeTextNode && position.Node.GetNextNode().SymbolCount > 0));
888if (position.Edge == ElementEdge.BeforeStart || position.Edge == ElementEdge.BeforeEnd)
1133startEdgePosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart);
1141endEdgePosition = new TextPointer(this, elementNode, ElementEdge.BeforeEnd);
1228insertPosition = new TextPointer(this, objectNode, ElementEdge.BeforeStart);
1295internal void GetNodeAndEdgeAtOffset(int offset, out SplayTreeNode node, out ElementEdge edge)
1302internal void GetNodeAndEdgeAtOffset(int offset, bool splitNode, out SplayTreeNode node, out ElementEdge edge)
1337edge = ElementEdge.BeforeStart;
1345edge = ElementEdge.AfterStart;
1350edge = ElementEdge.BeforeEnd;
1356edge = ElementEdge.AfterEnd;
1370node = ((TextTreeTextNode)node).Split(offset - nodeOffset, ElementEdge.AfterEnd);
1372edge = ElementEdge.BeforeStart;
1394internal void GetNodeAndEdgeAtCharOffset(int charOffset, out TextTreeNode node, out ElementEdge edge)
1408edge = ElementEdge.BeforeStart;
1435edge = ElementEdge.BeforeStart;
1440edge = ElementEdge.AfterStart;
1449edge = ElementEdge.BeforeStart;
1455edge = ElementEdge.AfterEnd;
1468node = ((TextTreeTextNode)node).Split(charOffset - nodeCharOffset, ElementEdge.AfterEnd);
1469edge = ElementEdge.BeforeStart;
1655startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward);
1686endPosition = new TextPointer(this, _rootNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
2168private SplayTreeNode AdjustForZeroWidthNode(SplayTreeNode node, ElementEdge edge)
2214else if (edge == ElementEdge.BeforeStart)
2319ElementEdge previousEdge;
2321ElementEdge nextEdge;
2350previousEdge = ElementEdge.AfterEnd;
2355previousEdge = ElementEdge.AfterStart;
2360nextEdge = ElementEdge.BeforeStart;
2365nextEdge = ElementEdge.BeforeEnd;
2545private void AdjustRefCountsForContentDelete(ref TextTreeNode previousNode, ElementEdge previousEdge,
2546ref TextTreeNode nextNode, ElementEdge nextEdge,
2600private void AdjustRefCountsForShallowDelete(ref TextTreeNode previousNode, ElementEdge previousEdge,
2601ref TextTreeNode nextNode,ElementEdge nextEdge,
2611firstContainedNode = firstContainedNode.IncrementReferenceCount(ElementEdge.BeforeStart, extractedElementNode.BeforeStartReferenceCount);
2620lastContainedNode = lastContainedNode.IncrementReferenceCount(ElementEdge.AfterEnd, extractedElementNode.AfterEndReferenceCount);
2649case ElementEdge.BeforeStart:
2653case ElementEdge.AfterStart:
2657case ElementEdge.BeforeEnd:
2663case ElementEdge.AfterEnd:
2671case ElementEdge.BeforeStart:
2675case ElementEdge.AfterStart:
2681case ElementEdge.BeforeEnd:
2685case ElementEdge.AfterEnd:
2808startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward);
2813endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
2991ElementEdge previousEdge;
2993ElementEdge nextEdge;
3003previousEdge = ElementEdge.AfterEnd;
3007previousEdge = ElementEdge.AfterStart;
3010nextEdge = ElementEdge.BeforeStart;
3014nextEdge = ElementEdge.BeforeEnd;
3452TextPointer startEdgePosition = new TextPointer(this, node, ElementEdge.BeforeStart);
3464TextPointer startEdgePosition = new TextPointer(this, node, ElementEdge.BeforeStart);
src\Framework\System\Windows\Documents\TextElement.cs (9)
308TextPointer contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward);
311TextPointer contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
334elementStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
367contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward);
400contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
441elementEnd = new TextPointer(tree, _textElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
1054beforeStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
1564tree.InsertTextInternal(new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd), textData);
1601position = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd);
src\Framework\System\Windows\Documents\TextPointer.cs (143)
299ElementEdge edge;
312internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge)
318internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection direction)
1833internal static DependencyObject GetAdjacentElement(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
1913ElementEdge edge;
1992ElementEdge edge;
2209ElementEdge edge;
2226case ElementEdge.BeforeStart:
2231edge = ElementEdge.AfterEnd;
2238edge = ElementEdge.AfterStart;
2242case ElementEdge.AfterStart:
2247edge = ElementEdge.BeforeStart;
2253edge = ElementEdge.BeforeEnd;
2258case ElementEdge.BeforeEnd:
2263edge = ElementEdge.AfterEnd;
2269edge = ElementEdge.AfterStart;
2273case ElementEdge.AfterEnd:
2278edge = ElementEdge.BeforeStart;
2285edge = ElementEdge.BeforeEnd;
2643void ITextPointer.MoveToElementEdge(ElementEdge edge)
2648internal void MoveToElementEdge(ElementEdge edge)
2848internal static TextTreeTextNode GetAdjacentTextNodeSibling(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
2876internal static TextTreeNode GetAdjacentSiblingNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
2884case ElementEdge.BeforeStart:
2888case ElementEdge.AfterStart:
2892case ElementEdge.BeforeEnd:
2897case ElementEdge.AfterEnd:
2906case ElementEdge.BeforeStart:
2910case ElementEdge.AfterStart:
2915case ElementEdge.BeforeEnd:
2919case ElementEdge.AfterEnd:
2937internal static int GetSymbolOffset(TextContainer tree, TextTreeNode node, ElementEdge edge)
2943case ElementEdge.BeforeStart:
2947case ElementEdge.AfterStart:
2951case ElementEdge.BeforeEnd:
2955case ElementEdge.AfterEnd:
2985ElementEdge edge;
3038if (edge == ElementEdge.BeforeStart && fixup.FirstContainedNode != null)
3046Invariant.Assert(edge == ElementEdge.BeforeStart, "edge BeforeStart is expected");
3056if (edge == ElementEdge.AfterEnd && fixup.LastContainedNode != null)
3064Invariant.Assert(edge == ElementEdge.AfterEnd, "edge AfterEnd is expected");
3092internal static TextTreeNode GetScopingNode(TextTreeNode node, ElementEdge edge)
3098case ElementEdge.BeforeStart:
3099case ElementEdge.AfterEnd:
3103case ElementEdge.AfterStart:
3104case ElementEdge.BeforeEnd:
3119internal bool GetNextNodeAndEdge(out TextTreeNode node, out ElementEdge edge)
3129internal static bool GetNextNodeAndEdge(TextTreeNode sourceNode, ElementEdge sourceEdge, bool plainTextOnly, out TextTreeNode node, out ElementEdge edge)
3154case ElementEdge.BeforeStart:
3164edge = ElementEdge.BeforeEnd;
3170edge = ElementEdge.BeforeEnd;
3171goto case ElementEdge.BeforeEnd;
3175case ElementEdge.AfterStart:
3182edge = ElementEdge.AfterStart;
3188edge = ElementEdge.AfterEnd;
3195edge = ElementEdge.AfterEnd;
3204case ElementEdge.BeforeEnd:
3210edge = ElementEdge.BeforeStart;
3219case ElementEdge.AfterEnd:
3229edge = ElementEdge.AfterStart;
3265if (edge == ElementEdge.BeforeStart)
3267edge = ElementEdge.BeforeEnd;
3273Invariant.Assert(edge == ElementEdge.AfterEnd);
3289internal bool GetPreviousNodeAndEdge(out TextTreeNode node, out ElementEdge edge)
3299internal static bool GetPreviousNodeAndEdge(TextTreeNode sourceNode, ElementEdge sourceEdge, bool plainTextOnly, out TextTreeNode node, out ElementEdge edge)
3323case ElementEdge.BeforeStart:
3331edge = ElementEdge.BeforeEnd;
3352case ElementEdge.AfterStart:
3359edge = ElementEdge.AfterEnd;
3368case ElementEdge.BeforeEnd:
3375edge = ElementEdge.BeforeEnd;
3381edge = ElementEdge.BeforeStart;
3388edge = ElementEdge.BeforeStart;
3397case ElementEdge.AfterEnd:
3407edge = ElementEdge.AfterStart;
3413edge = ElementEdge.AfterStart;
3414goto case ElementEdge.AfterStart;
3434if (edge == ElementEdge.AfterEnd)
3436edge = ElementEdge.AfterStart;
3442Invariant.Assert(edge == ElementEdge.BeforeStart);
3458internal static TextPointerContext GetPointerContextForward(TextTreeNode node, ElementEdge edge)
3466case ElementEdge.BeforeStart:
3470case ElementEdge.AfterStart:
3478goto case ElementEdge.BeforeEnd;
3482case ElementEdge.BeforeEnd:
3488case ElementEdge.AfterEnd:
3512internal static TextPointerContext GetPointerContextBackward(TextTreeNode node, ElementEdge edge)
3520case ElementEdge.BeforeStart:
3534case ElementEdge.AfterStart:
3540case ElementEdge.BeforeEnd:
3548goto case ElementEdge.AfterStart;
3552case ElementEdge.AfterEnd:
3777case ElementEdge.BeforeStart:
3781case ElementEdge.AfterStart:
3791case ElementEdge.BeforeEnd:
3792case ElementEdge.AfterEnd:
3881internal ElementEdge Edge
3885return (ElementEdge)(_flags & (uint)Flags.EdgeMask);
3922ElementEdge edge;
3956private void Initialize(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection gravity, uint generation,
3993private TextTreeNode AdjustRefCounts(TextTreeNode newNode, ElementEdge newNodeEdge, TextTreeNode oldNode, ElementEdge oldNodeEdge)
4016private static void RepositionForGravity(ref TextTreeNode node, ref ElementEdge edge, LogicalDirection gravity)
4019ElementEdge newEdge;
4026case ElementEdge.BeforeStart:
4030newEdge = ElementEdge.AfterEnd;
4034newEdge = ElementEdge.AfterStart;
4039case ElementEdge.AfterStart:
4043newEdge = ElementEdge.BeforeStart;
4047newEdge = ElementEdge.BeforeEnd;
4052case ElementEdge.BeforeEnd:
4056newEdge = ElementEdge.AfterEnd;
4060newEdge = ElementEdge.AfterStart;
4065case ElementEdge.AfterEnd:
4069newEdge = ElementEdge.BeforeStart;
4073newEdge = ElementEdge.BeforeEnd;
4086return (this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd) ? LogicalDirection.Forward : LogicalDirection.Backward;
4104internal static TextTreeNode GetAdjacentNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
4113if (edge == ElementEdge.AfterStart || edge == ElementEdge.BeforeEnd)
4128private void MoveToNode(TextContainer tree, TextTreeNode node, ElementEdge edge)
4170Invariant.Assert(this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd, "Bad position edge/gravity pair! (1)");
4175Invariant.Assert(this.Edge == ElementEdge.AfterStart || this.Edge == ElementEdge.AfterEnd, "Bad position edge/gravity pair! (2)");
4181Invariant.Assert(this.Edge != ElementEdge.BeforeStart && this.Edge != ElementEdge.AfterEnd, "Position at outer edge of root!");
4186Invariant.Assert(this.Edge != ElementEdge.AfterStart && this.Edge != ElementEdge.BeforeEnd, "Position at inner leaf node edge!");
4285private void SetNodeAndEdge(TextTreeNode node, ElementEdge edge)
4287Invariant.Assert(edge == ElementEdge.BeforeStart ||
4288edge == ElementEdge.AfterStart ||
4289edge == ElementEdge.BeforeEnd ||
4290edge == ElementEdge.AfterEnd);
4311ElementEdge edge = (ElementEdge)(_flags & (uint)Flags.EdgeMask);
4313Invariant.Assert(edge == ElementEdge.BeforeStart ||
4314edge == ElementEdge.AfterStart ||
4315edge == ElementEdge.BeforeEnd ||
4316edge == ElementEdge.AfterEnd);