static public void CheckAll(TreeNodeEx treeNode) { lock (m_syncRoot) { TreeViewEx treeView = (TreeViewEx)treeNode.TreeView; if (treeView != null) { treeView.SuspendCheckEvents(); } CheckBoxes.CheckAll((TreeNode)treeNode); if (treeView != null) { treeView.InvokeTreeViewExNodesChecked(); treeView.ResumeCheckEvents(); } } }
static public void CheckAll(TreeNode treeNode) { lock (m_syncRoot) { if (treeNode == null) { return; } TreeView treeView = treeNode.TreeView; if (treeView == null || !treeView.CheckBoxes) { return; } else { foreach (TreeNode childNode in treeNode.Nodes) { CheckBoxes.CheckAll(childNode); } } treeNode.Checked = true; } }