public static int GetNewIndex(this System.Windows.Forms.ListControl lstControl) #endif { if (_dictionaryOfNewIndexes.ContainsKey(lstControl.GetHashCode())) { return(_dictionaryOfNewIndexes[lstControl.GetHashCode()]); } else { return(-1); } }
/// <summary> /// Adds the item. /// </summary> /// <param name="lstControl">The list control instance.</param> public static void Clear(this System.Windows.Forms.ListControl lstControl) #endif { if (lstControl is System.Windows.Forms.ListBox) { ((System.Windows.Forms.ListBox)lstControl).Items.Clear(); } else if (lstControl is System.Windows.Forms.ComboBox) { ((System.Windows.Forms.ComboBox)lstControl).Items.Clear(); } _dictionaryOfNewIndexes[lstControl.GetHashCode()] = -1; }