Ejemplo n.º 1
0
        public override void PerformUndo(ITextBox textbox)
        {
            if (SelLength > 0)
            {
                textbox.SetCursorPosition(SelStart);
                textbox.InsertRange(SelectedText);
            }
            else
            {
                textbox.SetCursorPosition(Position);
                textbox.InsertRange(Data);
            }

            textbox.SelStart  = SelStart;
            textbox.SelLength = SelLength;
            textbox.SetCursorPosition(Position + 1);

            base.PerformUndo(textbox);
        }
Ejemplo n.º 2
0
        public override void PerformRedo(ITextBox textbox)
        {
            if (SelLength > 0)
            {
                textbox.DeleteRange(SelStart, SelLength);
                textbox.SelLength = 0;
                textbox.SetCursorPosition(Position);
                textbox.InsertRange(Data);
                textbox.SetCursorPosition(Position + DataLength);
                textbox.SelStart = Position + DataLength;
            }
            else
            {
                textbox.SetCursorPosition(Position);
                textbox.InsertRange(Data);
                textbox.SetCursorPosition(Position + DataLength);
                textbox.SelStart  = Position + DataLength;
                textbox.SelLength = 0;
            }

            base.PerformRedo(textbox);
        }
Ejemplo n.º 3
0
        public override void PerformUndo(ITextBox textbox)
        {
            textbox.DeleteRange(SelStart, DataLength);

            if (SelLength > 0)
            {
                textbox.SetCursorPosition(SelStart);
                textbox.InsertRange(SelectedText);
                textbox.SelStart  = SelStart;
                textbox.SelLength = SelLength;
            }
            else
            {
                textbox.SetCursorPosition(Position);
                textbox.SelStart  = Position;
                textbox.SelLength = 0;
            }

            base.PerformUndo(textbox);
        }