public void DeleteSelection() { DeleteTextAction action = new DeleteTextAction( this, this.SelectionStart, this.SelectionLength); RunAction(action); }
public override bool TryToMerge(IAction followingAction) { DeleteTextAction next = followingAction as DeleteTextAction; if (next != null && next.Textbox == this.Textbox) { if (next.selectionEnd == this.selectionStart) { this.selectionStart -= next.selectionLength; this.selectionLength += next.selectionLength; this.deletedText = next.deletedText + this.deletedText; next.Execute(); return(true); } else if (next.selectionStart == this.selectionStart) { this.selectionLength += next.selectionLength; this.deletedText += next.deletedText; next.Execute(); return(true); } } return(false); }