Exemplo n.º 1
0
        public override void PerformRedo(ITextBox textbox)
        {
            if (SelLength > 0)
            {
                textbox.DeleteRange(SelStart, SelLength);
                textbox.SetCursorPosition(SelStart);
            }
            else
            {
                textbox.DeleteRange(Position, DataLength);
                textbox.SetCursorPosition(Position);
            }

            textbox.SelStart  = SelStart;
            textbox.SelLength = 0;

            base.PerformRedo(textbox);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }