public void UpdatemyTreeNodeLeaf(myTreeNode.TREENODE_OBJ_TYPE objType, string text) { // search for a subnode that matches objType and update the text field if (Nodes.Count > 0) { foreach (myTreeNode mtn in Nodes) { if (mtn.type == objType) { mtn.Text = TextFromType(objType) + " " + text; } } } }
public void UpdatemyTreeNodeLeaf(myTreeNode.TREENODE_OBJ_TYPE objType, string text) { // search for a subnode that matches objType and update the text field if (Nodes.Count > 0) { foreach (myTreeNode mtn in Nodes) { if (mtn.type == objType) { mtn.Text = TextFromType(objType) + text; return; } } } // None found, so create AddMyTreeNodeObject(objType, TextFromType(objType) + text); }