// Token: 0x060072A5 RID: 29349 RVA: 0x0020ED78 File Offset: 0x0020CF78
        internal override ITextPointer GetTextPositionFromPoint(Point point, bool snapToText)
        {
            if (!this.IsValid)
            {
                throw new InvalidOperationException(SR.Get("TextViewInvalidLayout"));
            }
            ITextPointer textPositionFromPoint = TextParagraphView.GetTextPositionFromPoint(this.Lines, point, snapToText);

            Invariant.Assert(textPositionFromPoint == null || textPositionFromPoint.HasValidLayout);
            return(textPositionFromPoint);
        }
        // Token: 0x060072A9 RID: 29353 RVA: 0x0020EF7C File Offset: 0x0020D17C
        internal override bool IsAtCaretUnitBoundary(ITextPointer position)
        {
            if (!this.IsValid)
            {
                throw new InvalidOperationException(SR.Get("TextViewInvalidLayout"));
            }
            ValidationHelper.VerifyPosition(this._textContainer, position, "position");
            int lineFromPosition = TextParagraphView.GetLineFromPosition(this.Lines, position);
            int startPositionCP  = this.Lines[lineFromPosition].StartPositionCP;

            return(this._owner.IsAtCaretUnitBoundary(position, startPositionCP, lineFromPosition));
        }
        // Token: 0x060072AB RID: 29355 RVA: 0x0020F058 File Offset: 0x0020D258
        internal override ITextPointer GetBackspaceCaretUnitPosition(ITextPointer position)
        {
            if (!this.IsValid)
            {
                throw new InvalidOperationException(SR.Get("TextViewInvalidLayout"));
            }
            ValidationHelper.VerifyPosition(this._textContainer, position, "position");
            int          lineFromPosition           = TextParagraphView.GetLineFromPosition(this.Lines, position);
            int          startPositionCP            = this.Lines[lineFromPosition].StartPositionCP;
            ITextPointer backspaceCaretUnitPosition = this._owner.GetBackspaceCaretUnitPosition(position, startPositionCP, lineFromPosition);

            Invariant.Assert(backspaceCaretUnitPosition == null || backspaceCaretUnitPosition.HasValidLayout);
            return(backspaceCaretUnitPosition);
        }
        // Token: 0x060072B8 RID: 29368 RVA: 0x0020F35C File Offset: 0x0020D55C
        internal static int GetLineFromPoint(ReadOnlyCollection <LineResult> lines, Point point, bool snapToText)
        {
            int  result;
            bool flag = TextParagraphView.GetVerticalLineFromPoint(lines, point, snapToText, out result);

            if (flag)
            {
                flag = TextParagraphView.GetHorizontalLineFromPoint(lines, point, snapToText, ref result);
            }
            if (!flag)
            {
                return(-1);
            }
            return(result);
        }
        // Token: 0x060072AF RID: 29359 RVA: 0x0020F190 File Offset: 0x0020D390
        internal static ITextPointer GetTextPositionFromPoint(ReadOnlyCollection <LineResult> lines, Point point, bool snapToText)
        {
            int          lineFromPoint = TextParagraphView.GetLineFromPoint(lines, point, snapToText);
            ITextPointer result;

            if (lineFromPoint < 0)
            {
                result = null;
            }
            else
            {
                result = lines[lineFromPoint].GetTextPositionFromDistance(point.X);
            }
            return(result);
        }
        // Token: 0x060072AC RID: 29356 RVA: 0x0020F0D0 File Offset: 0x0020D2D0
        internal override TextSegment GetLineRange(ITextPointer position)
        {
            if (!this.IsValid)
            {
                throw new InvalidOperationException(SR.Get("TextViewInvalidLayout"));
            }
            if (position == null)
            {
                throw new ArgumentNullException("position");
            }
            ValidationHelper.VerifyPosition(this._textContainer, position, "position");
            ReadOnlyCollection <LineResult> lines = this.Lines;
            int lineFromPosition = TextParagraphView.GetLineFromPosition(lines, position);

            return(new TextSegment(lines[lineFromPosition].StartPosition, lines[lineFromPosition].GetContentEndPosition(), true));
        }
        // Token: 0x060072A8 RID: 29352 RVA: 0x0020EE9C File Offset: 0x0020D09C
        internal override ITextPointer GetPositionAtNextLine(ITextPointer position, double suggestedX, int count, out double newSuggestedX, out int linesMoved)
        {
            if (!this.IsValid)
            {
                throw new InvalidOperationException(SR.Get("TextViewInvalidLayout"));
            }
            if (position == null)
            {
                throw new ArgumentNullException("position");
            }
            ValidationHelper.VerifyPosition(this._textContainer, position, "position");
            newSuggestedX = suggestedX;
            linesMoved    = 0;
            if (count == 0)
            {
                return(position);
            }
            ReadOnlyCollection <LineResult> lines = this.Lines;
            int num = TextParagraphView.GetLineFromPosition(lines, position);

            if (num < 0 || num >= lines.Count)
            {
                throw new ArgumentOutOfRangeException("position");
            }
            int num2 = num;

            num        = Math.Max(0, num + count);
            num        = Math.Min(lines.Count - 1, num);
            linesMoved = num - num2;
            ITextPointer textPointer;

            if (linesMoved == 0)
            {
                textPointer = position;
            }
            else if (!DoubleUtil.IsNaN(suggestedX))
            {
                textPointer = lines[num].GetTextPositionFromDistance(suggestedX);
            }
            else
            {
                textPointer = lines[num].StartPosition.CreatePointer(LogicalDirection.Forward);
            }
            Invariant.Assert(textPointer == null || textPointer.HasValidLayout);
            return(textPointer);
        }