예제 #1
0
 public FlagCheckedListBoxItem Add(FlagCheckedListBoxItem item)
 {
     Items.Add(item);
     return item;
 }
예제 #2
0
 public bool IsMemberFlag(FlagCheckedListBoxItem item)
 {
     return (IsFlag && ((_value & item._value) == _value));
 }
예제 #3
0
 public FlagCheckedListBoxItem Add(int value, string caption)
 {
     FlagCheckedListBoxItem item = new FlagCheckedListBoxItem(value, caption);
     Items.Add(item);
     return item;
 }
예제 #4
0
        protected void UpdateCheckedItems(FlagCheckedListBoxItem item, CheckState checkState)
        {
            if (item._value == 0)
                UpdateCheckedItems(0);

            int sumValue = 0;
            for (int x = 0; x < Items.Count; x++)
            {
                FlagCheckedListBoxItem i = Items[x] as FlagCheckedListBoxItem;
                if (GetItemChecked(x))
                    sumValue |= i._value;
            }

            if (checkState == CheckState.Unchecked)
                sumValue = sumValue & (~item._value);
            else
                sumValue |= item._value;

            UpdateCheckedItems(sumValue);
        }