private void SetIcon(TreeNodeCollection Nodes) { for (int i = 0; i < Nodes.Count; i++) { if (Nodes[i].ImageIndex == 2 || Nodes[i].ImageIndex == 4 || Nodes[i].ImageIndex == 5) { treeFactory.SetNodeIcon((TreeNodeEx)(Nodes[i])); } if (Nodes[i].Nodes.Count > 0) { SetIcon(Nodes[i].Nodes); } } }