// Token: 0x06003D0D RID: 15629 RVA: 0x0011B8BC File Offset: 0x00119ABC
        internal TextTreeDeleteContentUndoUnit(TextContainer tree, TextPointer start, TextPointer end) : base(tree, start.GetSymbolOffset())
        {
            start.DebugAssertGeneration();
            end.DebugAssertGeneration();
            Invariant.Assert(start.GetScopingNode() == end.GetScopingNode(), "start/end have different scope!");
            TextTreeNode adjacentNode  = start.GetAdjacentNode(LogicalDirection.Forward);
            TextTreeNode adjacentNode2 = end.GetAdjacentNode(LogicalDirection.Forward);

            this._content = this.CopyContent(adjacentNode, adjacentNode2);
        }
コード例 #2
0
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        // Creates a new instance.
        // start/end span the content to copy into the new undo unit -- they
        // should always share the same scoping TextElement.
        internal TextTreeDeleteContentUndoUnit(TextContainer tree, TextPointer start, TextPointer end) : base(tree, start.GetSymbolOffset())
        {
            TextTreeNode node;
            TextTreeNode haltNode;

            start.DebugAssertGeneration();
            end.DebugAssertGeneration();
            Invariant.Assert(start.GetScopingNode() == end.GetScopingNode(), "start/end have different scope!");

            node = start.GetAdjacentNode(LogicalDirection.Forward);
            haltNode = end.GetAdjacentNode(LogicalDirection.Forward);

            // Walk the content, copying runs as we go.
            _content = CopyContent(node, haltNode);
        }
コード例 #3
0
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        // Creates a new instance.
        // start/end span the content to copy into the new undo unit -- they
        // should always share the same scoping TextElement.
        internal TextTreeDeleteContentUndoUnit(TextContainer tree, TextPointer start, TextPointer end) : base(tree, start.GetSymbolOffset())
        {
            TextTreeNode node;
            TextTreeNode haltNode;

            start.DebugAssertGeneration();
            end.DebugAssertGeneration();
            Invariant.Assert(start.GetScopingNode() == end.GetScopingNode(), "start/end have different scope!");

            node     = start.GetAdjacentNode(LogicalDirection.Forward);
            haltNode = end.GetAdjacentNode(LogicalDirection.Forward);

            // Walk the content, copying runs as we go.
            _content = CopyContent(node, haltNode);
        }
コード例 #4
0
ファイル: TextContainer.cs プロジェクト: sjyanxin/WPFSource
        // Wrapper for this.TextView.IsAtCaretUnitBoundary, adds a cache. 
        internal bool IsAtCaretUnitBoundary(TextPointer position)
        { 
            position.DebugAssertGeneration();
            Invariant.Assert(position.HasValidLayout);

            if (_rootNode.CaretUnitBoundaryCacheOffset != position.GetSymbolOffset()) 
            {
                _rootNode.CaretUnitBoundaryCacheOffset = position.GetSymbolOffset(); 
                _rootNode.CaretUnitBoundaryCache = _textview.IsAtCaretUnitBoundary(position); 

                if (!_rootNode.CaretUnitBoundaryCache && position.LogicalDirection == LogicalDirection.Backward) 
                {
                    // In MIL Text and TextView worlds, a position at trailing edge of a newline (with backward gravity)
                    // is not an allowed caret stop.
                    // However, in TextPointer world we must allow such a position to be a valid insertion position, 
                    // since it breaks textrange normalization for empty ranges.
                    // Hence, we need to check for TextView.IsAtCaretUnitBoundary in reverse direction here. 
 
                    TextPointer positionForwardGravity = position.GetPositionAtOffset(0, LogicalDirection.Forward);
                    _rootNode.CaretUnitBoundaryCache = _textview.IsAtCaretUnitBoundary(positionForwardGravity); 
                }
            }

            return _rootNode.CaretUnitBoundaryCache; 
        }