SIL.FieldWorks.IText.InterlinVc.AddLabelPile C# (CSharp) Method

AddLabelPile() public method

Add the pile of labels used to identify the lines in interlinear text.
public AddLabelPile ( IVwEnv vwenv, ITsStrFactory tsf, SIL.FieldWorks.FDO.FdoCache cache, bool fWantMultipleSenseGloss, bool fShowMorphemes ) : void
vwenv IVwEnv
tsf ITsStrFactory
cache SIL.FieldWorks.FDO.FdoCache
fWantMultipleSenseGloss bool
fShowMorphemes bool
return void
		public void AddLabelPile(IVwEnv vwenv, ITsStrFactory tsf, FdoCache cache,
			bool fWantMultipleSenseGloss, bool fShowMorphemes)
		{
			CheckDisposed();

			int wsUI = cache.DefaultUserWs;
			var spaceStr = TsStringUtils.MakeTss(" ", wsUI);
			vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTrailing,
				(int)FwTextPropVar.ktpvMilliPoint, 10000);
			vwenv.set_IntProperty((int)FwTextPropType.ktptBold,
				(int)FwTextPropVar.ktpvEnum,
				(int)FwTextToggleVal.kttvForceOn);
			vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
				(int)FwTextPropVar.ktpvMilliPoint,
				5000); // default spacing is fine for all embedded paragraphs.
			vwenv.OpenInnerPile();
			for (var i = 0; i < m_lineChoices.Count; i++)
			{
				InterlinLineSpec spec = m_lineChoices[i];
				if (!spec.WordLevel)
					break;
				SetColor(vwenv, LabelRGBFor(spec));
				ITsString tss = MakeUiElementString(m_lineChoices.LabelFor(spec.Flid), wsUI, null);
				var bldr = tss.GetBldr();
				if (m_lineChoices.RepetitionsOfFlid(spec.Flid) > 1)
				{
					bldr.Append(spaceStr);
					bldr.Append(spec.WsLabel(cache));
					AddLineIndexProperty(bldr, i);
					// Enhance GJM: Might be able to do without paragraph now?
					vwenv.OpenParagraph();
					vwenv.AddString(bldr.GetString());
					vwenv.CloseParagraph();
				}
				else
				{
					AddLineIndexProperty(bldr, i);
					vwenv.AddString(bldr.GetString());
				}

			}
			vwenv.CloseInnerPile();
		}