/// <inheritdoc /> public override void Do(DocumentEditorContext context) { var next = _nextPath.Get(context.Document); TextBlockHelperMethods.MergeWithPrevious((TextBlock)next); context.Selection.Replace(_endOfPreviousBlockHandle.GetCaret(context)); }
/// <inheritdoc /> public override void Undo(DocumentEditorContext context) { var caret = (TextCaret)_endOfPreviousBlockHandle.GetCaret(context); TextBlockHelperMethods.TryBreakBlock(caret); context.Selection.Replace(_originalCaretPosition.GetCaret(context)); }
/// <inheritdoc /> public override void Do(DocumentEditorContext context) { var caret = (TextCaret)_handle.GetCaret(context); var caretPosition = TextBlockHelperMethods.TryBreakBlock(caret); if (!caretPosition.IsValid) { return; } context.Selection.Replace(caretPosition); }
/// <inheritdoc /> public override void Undo(DocumentEditorContext context) { var caret = (TextCaret)_handle.GetCaret(context); var previousBlock = caret.Block; var nextBlock = previousBlock.NextBlock; TextBlockHelperMethods.MergeWithPrevious((TextBlock)nextBlock); // move it to where it was when we wanted to break the paragraph. It's safer to deserialize // again, as the cursor above is not guaranteed to be valid. context.Selection.MoveTo(_handle, context); }