Esempio n. 1
0
        /// <summary>
        /// Assigns a new text to the row.
        /// </summary>
        /// <param name="text"></param>
        public void SetText(string Text)
        {
            this.Document.StartUndoCapture();
            TextPoint tp = new TextPoint(0, this.Index);
            TextRange tr = new TextRange();
            tr.FirstColumn = 0;
            tr.FirstRow = tp.Y;
            tr.LastColumn = this.Text.Length;
            tr.LastRow = tp.Y;

            this.Document.StartUndoCapture();
            //delete the current line
            this.Document.PushUndoBlock(UndoAction.DeleteRange, this.Document.GetRange(tr), tr.FirstColumn, tr.FirstRow, this.RevisionMark);
            //alter the text
            this.Document.PushUndoBlock(UndoAction.InsertRange, Text, tp.X, tp.Y, this.RevisionMark);
            this.Text = Text;
            this.Document.EndUndoCapture();
            this.Document.InvokeChange();
        }
Esempio n. 2
0
 /// <summary>
 /// Selection Constructor.
 /// </summary>
 /// <param name="control">Control that will use this selection</param>
 public Selection(EditViewControl control)
 {
     Control = control;
     Bounds = new TextRange();
 }