SIL.FieldWorks.IText.InterlinDocForAnalysis.CanAddWordGlosses C# (CSharp) Метод

CanAddWordGlosses() приватный Метод

Answer whether the AddWordGlossesToFreeTranslation menu option should be enabled. Also get the Segment to which they can be added.
private CanAddWordGlosses ( ISegment &seg, int &ws ) : bool
seg ISegment The seg.
ws int The ws.
Результат bool
		private bool CanAddWordGlosses(out ISegment seg, out int ws)
		{
			seg = null;
			ws = 0; // actually meaningless unless it returns true, but make compiler happy.
			if (RootBox.Selection == null)
				return false;
			if (!Focused)
				return false;
			ITsString tss;
			int ich;
			int tag;
			bool fAssocPrev;
			int hvoSeg;
			RootBox.Selection.TextSelInfo(false, out tss, out ich, out fAssocPrev, out hvoSeg, out tag, out ws);
			if (tag != kTagUserPrompt)
				return false; // no good if not in a prompt for an empty translation.
			seg = Cache.ServiceLocator.GetInstance<ISegmentRepository>().GetObject(hvoSeg);
			if (seg == null)
				return false; // And must be a property of a segment (we only use these prompts for the two translation props)
			int dummy;
			if (ws == 0) // a prompt, use ws of first character.
				ws = tss.get_Properties(0).GetIntPropValues((int)FwTextPropType.ktptWs, out dummy);
			return true;
		}
InterlinDocForAnalysis