public override void AddObj(int hvoItem, IVwViewConstructor vc, int frag)
{
if (frag == (int)SIL.FieldWorks.FdoUi.VcFrags.kfragHeadWord)
{
// In the course of this AddObj, typically we get AddString calls for
// morpheme separators, AddObjProp for kflidLexemeForm,
// AddStringAltMember for the form of the LF, NoteDependency for a homograph number,
// and possibly AddString for the HN itself. We want to produce something like
// <item type="cf" lang="xkal">-de<hn lang="en">2</hn></item>
OpenItem("cf");
m_fDoingHeadword = true;
m_fAwaitingHeadwordForm = true;
}
// (LT-9374) Export Variant Type information for variants
if (frag == (int)SIL.FieldWorks.FdoUi.LexEntryVc.kfragVariantTypes)
{
m_fDoingVariantTypes = true;
OpenItem("variantTypes");
string icuCode = m_cache.LanguageWritingSystemFactoryAccessor.GetStrFromWs(m_cache.DefaultAnalWs);
m_writer.WriteAttributeString("lang", icuCode);
}
if (vc is InterlinVc && frag >= InterlinVc.kfragLineChoices && frag < InterlinVc.kfragLineChoices + (vc as InterlinVc).LineChoices.Count)
{
var spec = (vc as InterlinVc).LineChoices[frag - InterlinVc.kfragLineChoices];
if (spec.Flid == InterlinLineChoices.kflidLexGloss)
{
OpenItem("gls");
}
}
base.AddObj (hvoItem, vc, frag);
if (frag == (int)SIL.FieldWorks.FdoUi.VcFrags.kfragHeadWord)
{
CloseItem();
m_fDoingHeadword = false;
m_fDoingHomographNumber = false;
WritePendingItem("hn", ref m_tssPendingHomographNumber);
}
if (frag == (int)SIL.FieldWorks.FdoUi.LexEntryVc.kfragVariantTypes)
{
CloseItem();
m_fDoingVariantTypes = false;
}
if (vc is InterlinVc && frag >= InterlinVc.kfragLineChoices && frag < InterlinVc.kfragLineChoices + (vc as InterlinVc).LineChoices.Count)
{
var spec = (vc as InterlinVc).LineChoices[frag - InterlinVc.kfragLineChoices];
if (spec.Flid == InterlinLineChoices.kflidLexGloss)
{
CloseItem();
}
}
}