/// <summary> /// Updates items in the checked list box /// 'item' = The item that was checked/unchecked (can represent more than 1 bit) /// 'cs' = The check state of that item</summary> protected void UpdateCheckedItems(FlagCheckedListBoxItem item, CheckState cs) { // If the value of the item is 0, uncheck all non-zero items if (item.Value == 0) { UpdateCheckedItems(cs == CheckState.Checked ? 0 : Items.Cast <FlagCheckedListBoxItem>().ForEach(0, (x, i) => i |= x.Value)); } else { UpdateCheckedItems(cs == CheckState.Checked ? (Bitmask | item.Value) : (Bitmask & ~item.Value)); } }
// Returns true if this value is a member of the composite bit value public bool IsMemberFlag(FlagCheckedListBoxItem composite) { return(IsFlag && (Value & composite.Value) == Value); }
public HoveredItemEventArgs(FlagCheckedListBoxItem item) { Item = item; }
public FlagCheckedListBoxItem Add(FlagCheckedListBoxItem item) { Items.Add(item); return(item); }