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

SelectFirstTranslationOrNote() private method

Select the first non-null translation or note in the current segment of the current analysis occurance.
private SelectFirstTranslationOrNote ( ) : bool
return bool
		internal bool SelectFirstTranslationOrNote()
		{
			int ws;
			int annotationFlid = GetFirstVisibleTranslationOrNoteFlid(SelectedOccurrence.Segment, out ws);
			if (annotationFlid == 0) return false;
			var sel = MakeSandboxSel();
			int clev = sel.CLevels(true);
			clev--; // result it returns is one more than what the AllTextSelInfo routine wants.
			SelLevInfo[] rgvsli;
			using (ArrayPtr rgvsliTemp = MarshalEx.ArrayToNative<SelLevInfo>(clev))
			{
				int ihvoRoot;
				int cpropPrevious;
				int ichAnchor;
				int ichEnd;
				int ihvoEnd1;
				int tag, ws1;
				bool fAssocPrev;
				ITsTextProps ttp;
				sel.AllTextSelInfo(out ihvoRoot, clev, rgvsliTemp, out tag, out cpropPrevious,
								   out ichAnchor, out ichEnd, out ws1, out fAssocPrev, out ihvoEnd1, out ttp);
				rgvsli = MarshalEx.NativeToArray<SelLevInfo>(rgvsliTemp, clev);
			}
			// What non-word "choice" ie., translation text or note is on this line?
			int tagTextProp = ConvertTranslationOrNoteFlidToSegmentFlid(annotationFlid, SelectedOccurrence.Segment, ws);
			int levels;
			SelLevInfo noteLevel = MakeInnerLevelForFreeformSelection(tagTextProp);
			var vsli = new SelLevInfo[3];
			vsli[0] = noteLevel; // note or translation line
			vsli[1] = rgvsli[0]; // segment
			vsli[2] = rgvsli[1]; // para
			int cPropPrevious = 0; // todo: other if not the first WS for tagTextProp
			TryHideFocusBoxAndUninstall();
			RootBox.MakeTextSelection(0, vsli.Length, vsli, tagTextProp, cPropPrevious,
									  0, 0, 0, false, -1, null, true);
			Focus();
			return true;
		}

Same methods

InterlinDocForAnalysis::SelectFirstTranslationOrNote ( ISegment segment ) : IVwSelection
InterlinDocForAnalysis