Example #1
0
 /// <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));
     }
 }
Example #2
0
 // Returns true if this value is a member of the composite bit value
 public bool IsMemberFlag(FlagCheckedListBoxItem composite)
 {
     return(IsFlag && (Value & composite.Value) == Value);
 }
Example #3
0
 public HoveredItemEventArgs(FlagCheckedListBoxItem item)
 {
     Item = item;
 }
Example #4
0
 public FlagCheckedListBoxItem Add(FlagCheckedListBoxItem item)
 {
     Items.Add(item);
     return(item);
 }