MapView.DirPicker.FindNodeInNodes C# (CSharp) Method

FindNodeInNodes() private method

Purpose: finds the node with the given sNodetext in the collection tncNodes. If found, a reference to the nodeobject is returned, otherwise null is returned
private FindNodeInNodes ( string sNodeText, TreeNodeCollection tncNodes ) : TreeNode
sNodeText string Labeltext of TreeNode to find
tncNodes System.Windows.Forms.TreeNodeCollection Collection of TreeNode objects to search
return System.Windows.Forms.TreeNode
		private TreeNode FindNodeInNodes(string sNodeText, TreeNodeCollection tncNodes)
		{
			foreach(TreeNode tnNode in tncNodes)
			{
				// Thanks to Uwe Hein for this tip.
				if(tnNode.Text.ToUpper() == sNodeText.ToUpper())
				{
					// found it
					return tnNode;
				}
			}
			// not found
			return null;
		}