public bool hasCheckedNodes(MyTreeView tree) { bool has = false; for (int i = 0; i < tree.Nodes.Count && !has; i++) { if (tree.Nodes[i].Checked) { has = true; } } return(has); }
public void cambiarEventosTree(bool estado, MyTreeView tree) { if (tree == treeConjuntoMaterias) { if (estado) { treeConjuntoMaterias.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeConjuntoMaterias_AfterCheck); treeConjuntoMaterias.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeConjuntoMaterias_AfterSelect); } else { treeConjuntoMaterias.AfterCheck -= new System.Windows.Forms.TreeViewEventHandler(this.treeConjuntoMaterias_AfterCheck); treeConjuntoMaterias.AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(this.treeConjuntoMaterias_AfterSelect); } } else if (tree == treeMateria) { if (estado) { treeMateria.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeMateria_AfterCheck_1); treeMateria.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMateria_AfterSelect); } else { treeMateria.AfterCheck -= new System.Windows.Forms.TreeViewEventHandler(this.treeMateria_AfterCheck_1); treeMateria.AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(this.treeMateria_AfterSelect); } } else { if (estado) { treeGrupo.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeGrupo_AfterCheck); } else { treeGrupo.AfterCheck -= new System.Windows.Forms.TreeViewEventHandler(this.treeGrupo_AfterCheck); } } }