private static ExtremePositionInString ( int selStart, int selEnd, int selLength, bool isRightToLeft ) : WhichEnd | ||
selStart | int | the starting position of the selection |
selEnd | int | the end position of the selection |
selLength | int | the length of the string the selection is in |
isRightToLeft | bool | if set to |
Résultat | WhichEnd |
private static WhichEnd ExtremePositionInString(int selStart, int selEnd, int selLength, bool isRightToLeft)
{
if (0 == selLength)
return WhichEnd.Both;
//if (isRightToLeft ? selEnd >= selLength - 1 : selStart <= 0)
if (selStart <= 0)
return WhichEnd.Left;
//if (isRightToLeft ? selStart <= 0 : selEnd >= selLength - 1)
if (selEnd >= selLength)
return WhichEnd.Right; // this happens with punctuation at end!
return WhichEnd.Neither;
}