MS\Internal\PtsHost\BaseParagraph.cs (5)
180int openEdgeCp = TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeStart);
251return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.AfterStart);
255return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeStart);
272return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.BeforeEnd);
276return TextContainerHelper.GetCPFromElement(StructuralCache.TextContainer, Element, ElementEdge.AfterEnd);
System\Windows\Documents\TextContainer.cs (65)
466ElementEdge edge;
481ElementEdge edge;
505ElementEdge edge;
617ElementEdge edge;
630edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd;
641edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd;
849Invariant.Assert((position.Edge == ElementEdge.AfterEnd && position.Node.GetPreviousNode() is TextTreeTextNode && position.Node.GetPreviousNode().SymbolCount > 0) ||
850(position.Edge == ElementEdge.BeforeStart && position.Node.GetNextNode() is TextTreeTextNode && position.Node.GetNextNode().SymbolCount > 0));
868if (position.Edge == ElementEdge.BeforeStart || position.Edge == ElementEdge.BeforeEnd)
1113startEdgePosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart);
1121endEdgePosition = new TextPointer(this, elementNode, ElementEdge.BeforeEnd);
1208insertPosition = new TextPointer(this, objectNode, ElementEdge.BeforeStart);
1275internal void GetNodeAndEdgeAtOffset(int offset, out SplayTreeNode node, out ElementEdge edge)
1282internal void GetNodeAndEdgeAtOffset(int offset, bool splitNode, out SplayTreeNode node, out ElementEdge edge)
1317edge = ElementEdge.BeforeStart;
1325edge = ElementEdge.AfterStart;
1330edge = ElementEdge.BeforeEnd;
1336edge = ElementEdge.AfterEnd;
1350node = ((TextTreeTextNode)node).Split(offset - nodeOffset, ElementEdge.AfterEnd);
1352edge = ElementEdge.BeforeStart;
1374internal void GetNodeAndEdgeAtCharOffset(int charOffset, out TextTreeNode node, out ElementEdge edge)
1388edge = ElementEdge.BeforeStart;
1415edge = ElementEdge.BeforeStart;
1420edge = ElementEdge.AfterStart;
1429edge = ElementEdge.BeforeStart;
1435edge = ElementEdge.AfterEnd;
1448node = ((TextTreeTextNode)node).Split(charOffset - nodeCharOffset, ElementEdge.AfterEnd);
1449edge = ElementEdge.BeforeStart;
1635startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward);
1666endPosition = new TextPointer(this, _rootNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
2148private SplayTreeNode AdjustForZeroWidthNode(SplayTreeNode node, ElementEdge edge)
2194else if (edge == ElementEdge.BeforeStart)
2299ElementEdge previousEdge;
2301ElementEdge nextEdge;
2330previousEdge = ElementEdge.AfterEnd;
2335previousEdge = ElementEdge.AfterStart;
2340nextEdge = ElementEdge.BeforeStart;
2345nextEdge = ElementEdge.BeforeEnd;
2525private void AdjustRefCountsForContentDelete(ref TextTreeNode previousNode, ElementEdge previousEdge,
2526ref TextTreeNode nextNode, ElementEdge nextEdge,
2580private void AdjustRefCountsForShallowDelete(ref TextTreeNode previousNode, ElementEdge previousEdge,
2581ref TextTreeNode nextNode,ElementEdge nextEdge,
2591firstContainedNode = firstContainedNode.IncrementReferenceCount(ElementEdge.BeforeStart, extractedElementNode.BeforeStartReferenceCount);
2600lastContainedNode = lastContainedNode.IncrementReferenceCount(ElementEdge.AfterEnd, extractedElementNode.AfterEndReferenceCount);
2629case ElementEdge.BeforeStart:
2633case ElementEdge.AfterStart:
2637case ElementEdge.BeforeEnd:
2643case ElementEdge.AfterEnd:
2651case ElementEdge.BeforeStart:
2655case ElementEdge.AfterStart:
2661case ElementEdge.BeforeEnd:
2665case ElementEdge.AfterEnd:
2788startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward);
2793endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
2970ElementEdge previousEdge;
2972ElementEdge nextEdge;
2982previousEdge = ElementEdge.AfterEnd;
2986previousEdge = ElementEdge.AfterStart;
2989nextEdge = ElementEdge.BeforeStart;
2993nextEdge = ElementEdge.BeforeEnd;
3431TextPointer startEdgePosition = new TextPointer(this, node, ElementEdge.BeforeStart);
3443TextPointer startEdgePosition = new TextPointer(this, node, ElementEdge.BeforeStart);
System\Windows\Documents\TextElement.cs (9)
302TextPointer contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward);
305TextPointer contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
328elementStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
361contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward);
394contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward);
435elementEnd = new TextPointer(tree, _textElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
1008beforeStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
1515tree.InsertTextInternal(new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd), textData);
1549position = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd);
System\Windows\Documents\TextPointer.cs (143)
286ElementEdge edge;
299internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge)
305internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection direction)
1811internal static DependencyObject GetAdjacentElement(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
1891ElementEdge edge;
1970ElementEdge edge;
2184ElementEdge edge;
2201case ElementEdge.BeforeStart:
2206edge = ElementEdge.AfterEnd;
2213edge = ElementEdge.AfterStart;
2217case ElementEdge.AfterStart:
2222edge = ElementEdge.BeforeStart;
2228edge = ElementEdge.BeforeEnd;
2233case ElementEdge.BeforeEnd:
2238edge = ElementEdge.AfterEnd;
2244edge = ElementEdge.AfterStart;
2248case ElementEdge.AfterEnd:
2253edge = ElementEdge.BeforeStart;
2260edge = ElementEdge.BeforeEnd;
2612void ITextPointer.MoveToElementEdge(ElementEdge edge)
2617internal void MoveToElementEdge(ElementEdge edge)
2817internal static TextTreeTextNode GetAdjacentTextNodeSibling(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
2845internal static TextTreeNode GetAdjacentSiblingNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
2853case ElementEdge.BeforeStart:
2857case ElementEdge.AfterStart:
2861case ElementEdge.BeforeEnd:
2866case ElementEdge.AfterEnd:
2875case ElementEdge.BeforeStart:
2879case ElementEdge.AfterStart:
2884case ElementEdge.BeforeEnd:
2888case ElementEdge.AfterEnd:
2906internal static int GetSymbolOffset(TextContainer tree, TextTreeNode node, ElementEdge edge)
2912case ElementEdge.BeforeStart:
2916case ElementEdge.AfterStart:
2920case ElementEdge.BeforeEnd:
2924case ElementEdge.AfterEnd:
2954ElementEdge edge;
3007if (edge == ElementEdge.BeforeStart && fixup.FirstContainedNode != null)
3015Invariant.Assert(edge == ElementEdge.BeforeStart, "edge BeforeStart is expected");
3025if (edge == ElementEdge.AfterEnd && fixup.LastContainedNode != null)
3033Invariant.Assert(edge == ElementEdge.AfterEnd, "edge AfterEnd is expected");
3061internal static TextTreeNode GetScopingNode(TextTreeNode node, ElementEdge edge)
3067case ElementEdge.BeforeStart:
3068case ElementEdge.AfterEnd:
3072case ElementEdge.AfterStart:
3073case ElementEdge.BeforeEnd:
3088internal bool GetNextNodeAndEdge(out TextTreeNode node, out ElementEdge edge)
3098internal static bool GetNextNodeAndEdge(TextTreeNode sourceNode, ElementEdge sourceEdge, bool plainTextOnly, out TextTreeNode node, out ElementEdge edge)
3123case ElementEdge.BeforeStart:
3133edge = ElementEdge.BeforeEnd;
3139edge = ElementEdge.BeforeEnd;
3140goto case ElementEdge.BeforeEnd;
3144case ElementEdge.AfterStart:
3151edge = ElementEdge.AfterStart;
3157edge = ElementEdge.AfterEnd;
3164edge = ElementEdge.AfterEnd;
3173case ElementEdge.BeforeEnd:
3179edge = ElementEdge.BeforeStart;
3188case ElementEdge.AfterEnd:
3198edge = ElementEdge.AfterStart;
3234if (edge == ElementEdge.BeforeStart)
3236edge = ElementEdge.BeforeEnd;
3242Invariant.Assert(edge == ElementEdge.AfterEnd);
3258internal bool GetPreviousNodeAndEdge(out TextTreeNode node, out ElementEdge edge)
3268internal static bool GetPreviousNodeAndEdge(TextTreeNode sourceNode, ElementEdge sourceEdge, bool plainTextOnly, out TextTreeNode node, out ElementEdge edge)
3292case ElementEdge.BeforeStart:
3300edge = ElementEdge.BeforeEnd;
3321case ElementEdge.AfterStart:
3328edge = ElementEdge.AfterEnd;
3337case ElementEdge.BeforeEnd:
3344edge = ElementEdge.BeforeEnd;
3350edge = ElementEdge.BeforeStart;
3357edge = ElementEdge.BeforeStart;
3366case ElementEdge.AfterEnd:
3376edge = ElementEdge.AfterStart;
3382edge = ElementEdge.AfterStart;
3383goto case ElementEdge.AfterStart;
3403if (edge == ElementEdge.AfterEnd)
3405edge = ElementEdge.AfterStart;
3411Invariant.Assert(edge == ElementEdge.BeforeStart);
3427internal static TextPointerContext GetPointerContextForward(TextTreeNode node, ElementEdge edge)
3435case ElementEdge.BeforeStart:
3439case ElementEdge.AfterStart:
3447goto case ElementEdge.BeforeEnd;
3451case ElementEdge.BeforeEnd:
3457case ElementEdge.AfterEnd:
3481internal static TextPointerContext GetPointerContextBackward(TextTreeNode node, ElementEdge edge)
3489case ElementEdge.BeforeStart:
3503case ElementEdge.AfterStart:
3509case ElementEdge.BeforeEnd:
3517goto case ElementEdge.AfterStart;
3521case ElementEdge.AfterEnd:
3746case ElementEdge.BeforeStart:
3750case ElementEdge.AfterStart:
3760case ElementEdge.BeforeEnd:
3761case ElementEdge.AfterEnd:
3850internal ElementEdge Edge
3854return (ElementEdge)(_flags & (uint)Flags.EdgeMask);
3891ElementEdge edge;
3925private void Initialize(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection gravity, uint generation,
3962private TextTreeNode AdjustRefCounts(TextTreeNode newNode, ElementEdge newNodeEdge, TextTreeNode oldNode, ElementEdge oldNodeEdge)
3985private static void RepositionForGravity(ref TextTreeNode node, ref ElementEdge edge, LogicalDirection gravity)
3988ElementEdge newEdge;
3995case ElementEdge.BeforeStart:
3999newEdge = ElementEdge.AfterEnd;
4003newEdge = ElementEdge.AfterStart;
4008case ElementEdge.AfterStart:
4012newEdge = ElementEdge.BeforeStart;
4016newEdge = ElementEdge.BeforeEnd;
4021case ElementEdge.BeforeEnd:
4025newEdge = ElementEdge.AfterEnd;
4029newEdge = ElementEdge.AfterStart;
4034case ElementEdge.AfterEnd:
4038newEdge = ElementEdge.BeforeStart;
4042newEdge = ElementEdge.BeforeEnd;
4055return (this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd) ? LogicalDirection.Forward : LogicalDirection.Backward;
4073internal static TextTreeNode GetAdjacentNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction)
4082if (edge == ElementEdge.AfterStart || edge == ElementEdge.BeforeEnd)
4097private void MoveToNode(TextContainer tree, TextTreeNode node, ElementEdge edge)
4139Invariant.Assert(this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd, "Bad position edge/gravity pair! (1)");
4144Invariant.Assert(this.Edge == ElementEdge.AfterStart || this.Edge == ElementEdge.AfterEnd, "Bad position edge/gravity pair! (2)");
4150Invariant.Assert(this.Edge != ElementEdge.BeforeStart && this.Edge != ElementEdge.AfterEnd, "Position at outer edge of root!");
4155Invariant.Assert(this.Edge != ElementEdge.AfterStart && this.Edge != ElementEdge.BeforeEnd, "Position at inner leaf node edge!");
4254private void SetNodeAndEdge(TextTreeNode node, ElementEdge edge)
4256Invariant.Assert(edge == ElementEdge.BeforeStart ||
4257edge == ElementEdge.AfterStart ||
4258edge == ElementEdge.BeforeEnd ||
4259edge == ElementEdge.AfterEnd);
4280ElementEdge edge = (ElementEdge)(_flags & (uint)Flags.EdgeMask);
4282Invariant.Assert(edge == ElementEdge.BeforeStart ||
4283edge == ElementEdge.AfterStart ||
4284edge == ElementEdge.BeforeEnd ||
4285edge == ElementEdge.AfterEnd);