private void m_pOSPopupTreeManager_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
// Todo: user selected a part of speech.
// Arrange to turn all relevant items blue.
// Remember which item was selected so we can later 'doit'.
if (e.Node is HvoTreeNode)
{
var hvo = (e.Node as HvoTreeNode).Hvo;
var clid = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>().GetClsid(hvo);
if (clid == MoInflClassTags.kClassId)
{
m_selectedHvo = hvo;
m_selectedLabel = e.Node.Text;
}
else
{
m_tree.SelectedItem = null;
m_selectedHvo = 0;
m_selectedLabel = String.Empty;
}
}
else
{
m_selectedHvo = 0;
m_selectedLabel = String.Empty;
}
if (ControlActivated != null)
ControlActivated(this, new EventArgs());
// Tell the parent control that we may have changed the selected item so it can
// enable or disable the Apply and Preview buttons based on the selection.
if (ValueChanged != null)
ValueChanged(this, new FwObjectSelectionEventArgs(m_selectedHvo));
}