/// <summary> /// For internal use only. /// </summary> protected internal void ChangeItemSelectState(ListItemTester item, bool selected) { if (Disabled) { throw new ControlDisabledException(this); } string name = Attribute("name"); if (!Multiple) { Form.Variables.RemoveAll(name); } if (selected) { Form.Variables.Add(name, item.Value); } else { WebAssert.True(Multiple, "Can't deselect items unless list box is multi-select"); Form.Variables.Remove(name, item.Value); } Form.OptionalPostBack(Tag.OptionalAttribute("onchange")); }
/// <summary> /// For internal use only. /// </summary> protected internal void ChangeItemSelectState(ListItemTester item, bool selected) { if (Disabled) throw new ControlDisabledException(this); string name = Attribute("name"); if (!Multiple) Form.Variables.RemoveAll(name); if (selected) { Form.Variables.Add(name, item.Value); } else { WebAssert.True(Multiple, "Can't deselect items unless list box is multi-select"); Form.Variables.Remove(name, item.Value); } Form.OptionalPostBack(Tag.OptionalAttribute("onchange")); }
/// <summary> /// Determines whether the collection contains the specified item. /// </summary> /// <param name="item">A System.Web.UI.WebControls.ListItem to search for in the collection.</param> /// <returns>true if the collection contains the specified item; otherwise, false.</returns> public bool Contains(ListItemTester item) { return InnerList.Contains(item); }
/// <summary> /// Determines whether the collection contains the specified item. /// </summary> /// <param name="item">A System.Web.UI.WebControls.ListItem to search for in the collection.</param> /// <returns>true if the collection contains the specified item; otherwise, false.</returns> public bool Contains(ListItemTester item) { return(InnerList.Contains(item)); }