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

GetCurrentSelection() private method

Gets the current selection and returns enough data to move the IP.
private GetCurrentSelection ( int &clev, SIL.FieldWorks.Common.COMInterfaces.SelLevInfo &rgvsli, int &tag, int &ichAnchor, int &ichEnd, int &ws ) : bool
clev int The number of levels of selection range results.
rgvsli SIL.FieldWorks.Common.COMInterfaces.SelLevInfo The selection range with clev levels of structure.
tag int The property of the bottom-level [0] object that is of interest.
ichAnchor int The start index of the text selection.
ichEnd int The end index of the text selection.
ws int Index of the writing system of the selection.
return bool
		private bool GetCurrentSelection(out int clev, out SelLevInfo[] rgvsli, out int tag, out int ichAnchor, out int ichEnd, out int ws)
		{
			clev = -1;
			rgvsli = null;
			tag = -1;
			ichAnchor = -1;
			ichEnd = -1;
			ws = -1;
			var sel = EditingHelper.RootBoxSelection;
			if (sel == null)
				return false;
			// which "line choice" is active in this segment?
			if (sel.SelType != VwSelType.kstText || !sel.IsValid || !sel.IsEditable)
				return false;
			clev = sel.CLevels(true);
			ITsTextProps ttp;
			using (ArrayPtr rgvsliTemp = MarshalEx.ArrayToNative<SelLevInfo>(clev))
			{
				int ihvoRoot;
				int ihvoEnd1;
				int cpropPrevious;
				bool fAssocPrev;
				sel.AllTextSelInfo(out ihvoRoot, clev, rgvsliTemp, out tag, out cpropPrevious,
								   out ichAnchor, out ichEnd, out ws, out fAssocPrev, out ihvoEnd1, out ttp);
				rgvsli = MarshalEx.NativeToArray<SelLevInfo>(rgvsliTemp, clev);
			}
			return true;
		}
InterlinDocForAnalysis