/// <summary>
            ///  Same thing for GetChecked.
            /// </summary>
            internal void SetCheckedState(int index, CheckState value)
            {
                bool isChecked;
                bool isIndeterminate;

                switch (value)
                {
                case CheckState.Checked:
                    isChecked       = true;
                    isIndeterminate = false;
                    break;

                case CheckState.Indeterminate:
                    isChecked       = false;
                    isIndeterminate = true;
                    break;

                default:
                    isChecked       = false;
                    isIndeterminate = false;
                    break;
                }

                bool wasChecked       = InnerArray.GetState(index, s_checkedItemMask);
                bool wasIndeterminate = InnerArray.GetState(index, s_indeterminateItemMask);

                InnerArray.SetState(index, s_checkedItemMask, isChecked);
                InnerArray.SetState(index, s_indeterminateItemMask, isIndeterminate);

                if (wasChecked != isChecked || wasIndeterminate != isIndeterminate)
                {
                    // Raise a notify event that this item has changed.
                    _owner.AccessibilityNotifyClients(AccessibleEvents.StateChange, index);
                }
            }