Opc.Ua.ServerTest.TestCaseTreeCtrl.SetCheckState C# (CSharp) Method

SetCheckState() private method

Recursively toggles the check state for the nodes.
private SetCheckState ( TreeNode parent, bool isChecked ) : void
parent System.Windows.Forms.TreeNode
isChecked bool
return void
        private void SetCheckState(TreeNode parent, bool isChecked)
        {
            parent.Checked = isChecked;

            ServerTestCase testCase = parent.Tag as ServerTestCase;

            if (testCase != null)
            {
                testCase.Enabled = isChecked;
            }

            foreach (TreeNode child in parent.Nodes)
            {
                SetCheckState(child, isChecked);
            }
        }