src/Misc/EFTools/EntityDesign/VisualStudio/ModelWizard/gui/DatabaseObjectTreeView.cs
// <summary>
//     Once a given node has been checked this method updates the Checked
//     state of various other nodes to match.
// </summary>
Once a given node has been checked this method updates the Checked
state of various other nodes to match.
Once a given node has been checked this method updates the Checked state of various other nodes to match .
private static void UpdateChildrenNodesCheckedState(TreeNode parentNode)
        {
            var nodeChecked = parentNode.Checked;
            var nodeDepth = GetNodeDepth(parentNode);
            if (nodeDepth < 2)
            {
                foreach (TreeNode childNode in parentNode.Nodes)
                {
                    if (childNode.Checked != nodeChecked)
                    {
                        childNode.Checked = nodeChecked;
                    }
                    foreach (TreeNode grandchildNode in childNode.Nodes)
                    {
                        if (grandchildNode.Checked != nodeChecked)
                        {
                            grandchildNode.Checked = nodeChecked;
                        }
                    }
                }
            }
            if (nodeDepth > 0)
            {
                UpdateParentNodeCheckedState(parentNode);
            }
        }
private static void UpdateChildrenNodesCheckedState ( TreeNode parentNode ) { var nodeChecked = parentNode . Checked ; var nodeDepth = GetNodeDepth ( parentNode ) ; if ( nodeDepth < 2 ) { foreach ( TreeNode childNode in parentNode . Nodes ) { if ( childNode . Checked != nodeChecked ) { childNode . Checked = nodeChecked ; } foreach ( TreeNode grandchildNode in childNode . Nodes ) { if ( grandchildNode . Checked != nodeChecked ) { grandchildNode . Checked = nodeChecked ; } } } } if ( nodeDepth > 0 ) { UpdateParentNodeCheckedState ( parentNode ) ; } }
Once a given node has been checked this method updates the Checked
state of various other nodes to match.
Once a given node has been checked this method updates the Checked state of various other nodes to match .
// nodeDepth value: 0 => rootNode, 1 => schemaNode, 2 => leafNode // Root or schema node check changed: this is one of the Tables,  // Views or Stored Procedures root nodes or one of their child nodes // which represent individual schemas. // Iterate over the node's children (and grandchildren if it has any)  // and update their checked state. // a schema or leaf node's Checked state has changed - update the parent  // node's Checked state recursively up the tree
parentNode
TreeNode