Alsing.SourceCode.Row.SetText C# (CSharp) Метод

SetText() публичный Метод

Assigns a new text to the row.
public SetText ( string text ) : void
text string
Результат void
        public void SetText(string text)
        {
            Document.StartUndoCapture();
            var tp = new TextPoint(0, Index);
            var tr = new TextRange {FirstColumn = 0, FirstRow = tp.Y, LastColumn = Text.Length, LastRow = tp.Y};

            Document.StartUndoCapture();
            //delete the current line
            Document.PushUndoBlock(UndoAction.DeleteRange, Document.GetRange(tr), tr.FirstColumn, tr.FirstRow);
            //alter the text
            Document.PushUndoBlock(UndoAction.InsertRange, text, tp.X, tp.Y);
            Text = text;
            Document.EndUndoCapture();
            Document.InvokeChange();
        }