Dev2.Models.ExplorerItemModel.VerifyCheckState C# (CSharp) Method

VerifyCheckState() public method

Verifies the state of the IsChecked property by taking the childrens IsChecked State into account
public VerifyCheckState ( ) : void
return void
        public virtual void VerifyCheckState()
        {
            bool? state = null;
            var count = Children.Count;
            var i = 0;
            var stateNull = false;
            while(i < count && !stateNull)
            {
                var current = Children.ToArray()[i].IsChecked;
                if(i == 0)
                {
                    state = current;
                }
                else if(state != current)
                {
                    state = null;
                    stateNull = true;
                }
                i++;
            }
            SetIsChecked(state, false, true);
        }