Exemplo n.º 1
0
        private void Fix_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            int fixedCount = Fixed.Sum(x => x ? 1 : 0);

            if (e.NewValue == CheckState.Unchecked)
            {
                Fixed[e.Index] = false;
                return;
            }

            if (fixedCount == 6)
            {
                e.NewValue = e.CurrentValue;
            }
            else
            {
                if (Excluded[e.Index])
                {
                    Exclude.SetItemCheckState(e.Index, CheckState.Unchecked);
                }
                Fixed[e.Index] = true;
            }
        }