LayoutFarm.Text.EditableTextLine.SplitToNewLine C# (CSharp) Метод

SplitToNewLine() приватный Метод

private SplitToNewLine ( EditableRun startVisualElement ) : EditableTextLine
startVisualElement EditableRun
Результат EditableTextLine
        internal EditableTextLine SplitToNewLine(EditableRun startVisualElement)
        {
            LinkedListNode<EditableRun> curNode = GetLineLinkedNode(startVisualElement);
            EditableTextLine newSplitedLine = editableFlowLayer.InsertNewLine(this.currentLineNumber + 1);
            newSplitedLine.LocalSuspendLineReArrange();
            while (curNode != null)
            {
                LinkedListNode<EditableRun> tobeRemovedNode = curNode;
                curNode = curNode.Next;
                if (tobeRemovedNode.List != null)
                {
                    EditableRun tmpv = tobeRemovedNode.Value;
                    base.Remove(tobeRemovedNode);
                    newSplitedLine.AddLast(tmpv);
                }
                else
                {
                }
            }
            newSplitedLine.LocalResumeLineReArrange();
            return newSplitedLine;
        }
    }

Usage Example

            public void Accept()
            {
                EditableRun v            = null;
                int         sourceLineId = feeder.CurrentLineId;

                if (this.currentRelocatorLineId == sourceLineId)
                {
                }
                else if (sourceLineId > this.currentRelocatorLineId)
                {
                    v = feeder.UnsafeRemoveCurrent();
                    currentLine.UnsafeAddLast(v);

                    if (feeder.IsUnStableBlankLine)
                    {
                        feeder.RemoveCurrentBlankLine();
                    }
                }
                else
                {
                    v = feeder.CurrentRun;
                    EditableTextLine sourceLine = v.OwnerEditableLine;
                    sourceLine.SplitToNewLine(v);
                    feeder.Read(); currentRelocatorLineId = sourceLineId + 1;
                    currentLine = sourceLines[currentRelocatorLineId];
                }
                isFirstRunOfLine = false;
            }
All Usage Examples Of LayoutFarm.Text.EditableTextLine::SplitToNewLine