internal IVwSelection SelectFirstTranslationOrNote(ISegment segment)
{
if (segment == null)
return null;
int ws;
int annotationFlid = GetFirstVisibleTranslationOrNoteFlid(segment, out ws);
if (annotationFlid == 0)
return null;
int tagTextProp = ConvertTranslationOrNoteFlidToSegmentFlid(annotationFlid, segment, ws);
SelLevInfo noteLevel = MakeInnerLevelForFreeformSelection(tagTextProp);
// notes and translation lines have 3 levels: 2:para, 1:seg, 0:content or self property
var vsli = new SelLevInfo[3];
vsli[0] = noteLevel; // note or translation line
vsli[1].ihvo = segment.IndexInOwner; // specifies where segment is in para
vsli[1].tag = StTxtParaTags.kflidSegments;
vsli[2].ihvo = segment.Paragraph.IndexInOwner; // specifies where para is in IStText.
vsli[2].tag = StTextTags.kflidParagraphs;
int cPropPrevious = 0; // todo: other if not the first WS for tagTextProp
var sel = RootBox.MakeTextSelection(0, vsli.Length, vsli, tagTextProp, cPropPrevious,
0, 0, 0, false, 0, null, true);
Focus();
TryHideFocusBoxAndUninstall();
return sel;
}