private bool DetectDownMove(KeyEventArgs e, IEnumerable<InterlinLineSpec> lines, int lineNum,
ISegment curSeg, int curNoteIndex, bool isRightToLeft, WhichEnd where)
{
var annotationsAfter = lines.Skip(lineNum + 1);
bool hasFollowingAnnotation = false;
if (annotationsAfter.Any()) // might not have any
{
bool hasNotesAfter = annotationsAfter.Any(line => line.Flid == InterlinLineChoices.kflidNote);
hasFollowingAnnotation = HasVisibleTranslationOrNote(curSeg, annotationsAfter);
}
else
{ // this is the last translation or note and it can't be a null note because it was selected
bool noteIsLastAnnotation = LineChoices[LineChoices.Count - 1].Flid == InterlinLineChoices.kflidNote;
hasFollowingAnnotation = noteIsLastAnnotation && curNoteIndex < curSeg.NotesOS.Count - 1;
}
bool hasDownMotion = (e.KeyCode == Keys.Down) ||
(TextIsRightToLeft ?
(e.KeyCode == Keys.Left && (where == WhichEnd.Left || where == WhichEnd.Both)) :
(e.KeyCode == Keys.Right && (where == WhichEnd.Right || where == WhichEnd.Both)));
return hasDownMotion && !hasFollowingAnnotation;
}