/// <summary>
        /// Delete the node or the character behind the cursor
        /// </summary>
        public async Task <bool> ActionDeleteNodeOrSignBehindCursorPos(XmlCursorPos position, SetUndoSnapshotOptions setUnDoSnapshot)
        {
            if (!this.ActionsAllowed)
            {
                return(false);
            }

            if (setUnDoSnapshot == SetUndoSnapshotOptions.Yes)
            {
                this.editorState.UndoHandler.SetSnapshot("delete", this.editorState.CursorRaw);
            }

            var deleteArea = new XmlCursor();

            deleteArea.StartPos.SetPos(position.ActualNode, position.PosOnNode, position.PosInTextNode);
            var endPos = deleteArea.StartPos.Clone();
            await CursorPosMoveHelper.MoveRight(endPos, this.editorState.RootNode, this.xmlRules);

            deleteArea.EndPos.SetPos(endPos.ActualNode, endPos.PosOnNode, endPos.PosInTextNode);
            await deleteArea.OptimizeSelection();

            if (deleteArea.StartPos.ActualNode == this.editorState.RootNode)
            {
                return(false);                                                             // You must not delete the rootnot
            }
            var deleteResult = await XmlCursorSelectionHelper.DeleteSelection(deleteArea);

            if (deleteResult.Success)
            {
                // After successful deletion the new CursorPos is retrieved here
                await this.editorState.CursorRaw.SetPositions(deleteResult.NewCursorPosAfterDelete.ActualNode, deleteResult.NewCursorPosAfterDelete.PosOnNode, deleteResult.NewCursorPosAfterDelete.PosInTextNode, throwChangedEventWhenValuesChanged : false);

                await this.editorState.FireContentChangedEvent(needToSetFocusOnEditorWhenLost : false, forceFullRepaint : false);

                return(true);
            }

            return(false);
        }
 public async Task <bool> MoveRight(XmlCursorPos cursorPos)
 {
     return(await CursorPosMoveHelper.MoveRight(cursorPos, this.editorContext.EditorState.RootNode, this.editorContext.XmlRules));
 }