public void Deselect(int nIndex, MHEngine engine) { MHListItem pListItem = m_ItemList[nIndex - 1]; if (pListItem == null || !pListItem.Selected) { return; // Ignore if not selected. } pListItem.Selected = false; engine.EventTriggered(this, EventItemDeselected, new MHUnion(nIndex)); }
public void Select(int nIndex, MHEngine engine) { MHListItem pListItem = m_ItemList[nIndex - 1]; if (pListItem == null || pListItem.Selected) { return; // Ignore if already selected. } if (!m_fMultipleSelection) { // Deselect any existing selections. for (int i = 0; i < (int)m_ItemList.Count; i++) { if (m_ItemList[i].Selected) { Deselect(i + 1, engine); } } } pListItem.Selected = true; engine.EventTriggered(this, EventItemSelected, new MHUnion(nIndex)); }