/// <summary> /// Get the logical text position from a visual position. /// </summary> /// <param name="visualIndex">The visual position of a character</param> /// <returns>The index of this character in the text</returns> public int GetLogicalIndex(int visualIndex) { var ret = NativeMethods.ubidi_getLogicalIndex(_biDi, visualIndex, out var errorCode); ExceptionFromErrorCode.ThrowIfError(errorCode, "Get logical index failed! " + errorCode); return(ret); }