Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
765
Finding a Node In A Collection
posted

I've assigned keys (strings) to all of my nodes in the tree. Now I would like to retrieve one of these nodes but I am not always certain if the key is in the tree or not.  I'm used to using TryGetValue in dictionaries but this dosen't seem to be supported.  I don't want to throw a KeyNotFound exception.  How do I test if the key is valid?  I've tried tree.Nodes.IndexOf("keystring") but it always returns -1.