private void DisplayWordGloss(InterlinLineSpec spec, int choiceIndex)
{
switch(m_defaultObj.ClassID)
{
case WfiWordformTags.kClassId:
m_this.SetColor(m_vwenv, m_this.LabelRGBFor(choiceIndex)); // looks like missing word gloss.
m_vwenv.AddString(m_this.m_tssMissingGloss);
break;
case WfiAnalysisTags.kClassId:
if (m_hvoDefault != m_hvoWordBundleAnalysis)
{
// Real analysis isn't what we're displaying, so morph breakdown
// is a guess. Is it a human-approved guess?
bool isHumanGuess = m_this.Decorator.get_IntProp(m_hvoDefault, InterlinViewDataCache.OpinionAgentFlid) !=
(int)AnalysisGuessServices.OpinionAgent.Parser;
m_this.SetGuessing(m_vwenv, isHumanGuess ? ApprovedGuessColor : MachineGuessColor);
}
var wa = (IWfiAnalysis) m_defaultObj;
if (wa.MeaningsOC.Count == 0)
{
// There's no gloss, display something indicating it is missing.
m_this.SetColor(m_vwenv, m_this.LabelRGBFor(choiceIndex));
m_vwenv.AddString(m_this.m_tssMissingGloss);
}
else
{
m_vwenv.AddObj(wa.MeaningsOC.First().Hvo, m_this, kfragLineChoices + choiceIndex);
}
break;
case WfiGlossTags.kClassId:
if (m_hvoWordBundleAnalysis == m_hvoDefault)
{
var wsActual = spec.WritingSystem;
if (spec.IsMagicWritingSystem)
wsActual = GetRealWs(m_cache, m_hvoWordBundleAnalysis, spec, m_this.m_wsAnalysis);
// We're displaying properties of the current object, can do
// straightforwardly
m_this.FormatGloss(m_vwenv, wsActual);
m_vwenv.set_IntProperty((int)FwTextPropType.ktptSpellCheck, (int)FwTextPropVar.ktpvEnum,
(int)SpellingModes.ksmForceCheck);
m_vwenv.AddObj(m_hvoWordBundleAnalysis, m_this, kfragLineChoices + choiceIndex);
}
else
{
m_this.SetGuessing(m_vwenv);
m_vwenv.AddObj(m_hvoDefault, m_this, kfragLineChoices + choiceIndex);
}
break;
default:
throw new Exception("Invalid type found in Segment analysis");
}
}