Наследование: GuiLabs.Undo.AbstractAction
Пример #1
0
        private void MultilevelTextbox_TextChanged(object sender, EventArgs e)
        {
            if (guard)
            {
                return;
            }
            guard = true;

            var action = new MultilevelUndoTextboxChangeAction(MultilevelTextbox, oldText, oldSelectionStart, oldSelectionLength);

            multilevelTextboxActionManager.RecordAction(action);
            oldText            = MultilevelTextbox.Text;
            oldSelectionStart  = MultilevelTextbox.SelectionStart;
            oldSelectionLength = MultilevelTextbox.SelectionLength;
            UpdateMultilevelUndoRedoButtons();

            guard = false;
        }
Пример #2
0
        public override bool TryToMerge(IAction followingAction)
        {
            MultilevelUndoTextboxChangeAction action = followingAction as MultilevelUndoTextboxChangeAction;

            if (action == null)
            {
                return(false);
            }

            var timeDelta = action.timestamp.Subtract(this.timestamp);

            if (timeDelta.Seconds > 3)
            {
                return(false);
            }

            this.newText            = action.newText;
            this.newSelectionStart  = action.newSelectionStart;
            this.newSelectionLength = action.newSelectionLength;
            SetText(newText, newSelectionStart, newSelectionLength);
            return(true);
        }
Пример #3
0
        private void MultilevelTextbox_TextChanged(object sender, EventArgs e)
        {
            if (guard)
            {
                return;
            }
            guard = true;

            var action = new MultilevelUndoTextboxChangeAction(MultilevelTextbox, oldText, oldSelectionStart, oldSelectionLength);
            multilevelTextboxActionManager.RecordAction(action);
            oldText = MultilevelTextbox.Text;
            oldSelectionStart = MultilevelTextbox.SelectionStart;
            oldSelectionLength = MultilevelTextbox.SelectionLength;
            UpdateMultilevelUndoRedoButtons();

            guard = false;
        }