public void AddEmbeddedControl(ListViewItem.ListViewSubItem subItem, Control control) { if ( subItem == null || control == null ) throw new Exception("Invalid parameter"); // Add control and associate the control with the ListViewItem hash code embeddedControlsHashTable.Add(subItem.GetHashCode(), new ListViewEmbeddedControl(control)); }
public void RemoveEmbeddedControl(ListViewItem.ListViewSubItem subItem, Control control) { // Check for a valid parameter if ( subItem == null || control == null ) throw new Exception("Invalid parameter"); // Remove the control associate with this subitem embeddedControlsHashTable.Remove(subItem.GetHashCode()); }
ListViewEmbeddedControl GetEmbeddedControl(ListViewItem.ListViewSubItem subItem) { int hashCode = subItem.GetHashCode(); return (ListViewEmbeddedControl)embeddedControlsHashTable[hashCode]; }