private void m_lnkSpecify_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (m_fObjectConcorded)
{
ICmObject cmCurrent = null;
if (m_clerk.CurrentObjectHvo != 0)
{
int hvoCurrent = m_clerk.VirtualListPublisher.get_ObjectProp(m_clerk.CurrentObjectHvo,
ConcDecorator.kflidAnalysis);
if (hvoCurrent != 0)
cmCurrent = m_cache.ServiceLocator.GetObject(hvoCurrent);
// enhance JohnT: if we aren't concording on an analysis, we could still get the BeginOffset
// from the ParaFragment, and figure which analysis that is part of or closest to.
}
ITsString tss = null;
int ws = 0;
if (cmCurrent != null)
{
var wordform = (IWfiWordform)cmCurrent.OwnerOfClass(WfiWordformTags.kClassId);
if (wordform != null)
{
tss = wordform.Form.BestVernacularAlternative;
ITsTextProps ttp = tss.get_PropertiesAt(0);
int nVar;
ws = ttp.GetIntPropValues((int)FwTextPropType.ktptWs, out nVar);
}
}
if (tss == null)
{
ws = m_cache.DefaultVernWs;
tss = m_cache.TsStrFactory.MakeString("", ws);
}
SetDefaultVisibilityOfItems(true, String.Empty);
m_fObjectConcorded = false;
SetConcordanceLine(ConcordanceLines.kWord);
SetWritingSystem(ws);
m_tbSearchText.Tss = tss;
}
else if (m_hvoMatch != 0)
{
InitializeConcordanceSearch(m_cache.ServiceLocator.GetObject(m_hvoMatch));
}
}