SIL.FieldWorks.IText.InterlinDocForAnalysis.ExtremePositionInString C# (CSharp) Method

ExtremePositionInString() private static method

Determines if the selection is at the start, end or other position in the string. Accounts for writing system direction based on the line spec.
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 true the writing system of this line is right to left, otherwise ltr.
return 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;
		}
InterlinDocForAnalysis