LayoutFarm.Text.InternalTextLayerController.ReplaceCurrentTextRunContent C# (CSharp) Method

ReplaceCurrentTextRunContent() public method

public ReplaceCurrentTextRunContent ( int nBackSpace, EditableRun newTextRun ) : void
nBackSpace int
newTextRun EditableRun
return void
        public void ReplaceCurrentTextRunContent(int nBackSpace, EditableRun newTextRun)
        {
            if (newTextRun != null)
            {
                EnableUndoHistoryRecording = false; for (int i = 0; i < nBackSpace; i++)
                {
                    DoBackspace();
                }
                EnableUndoHistoryRecording = true;
                int startLineNum = textLineWriter.LineNumber;
                int startCharIndex = textLineWriter.CharIndex;
                textLineWriter.AddTextSpan(newTextRun);
                textLineWriter.EnsureCurrentTextRun();
                commandHistory.AddDocAction(
                    new DocActionInsertRuns(
                        new EditableRun[] { newTextRun }, startLineNum, startCharIndex,
                        textLineWriter.LineNumber, textLineWriter.CharIndex));
            }
        }