Opc.Ua.Server.NodeSource.Find C# (CSharp) Method

Find() protected method

Finds the node identified by the relative path.
protected Find ( IList relativePath, int index ) : NodeSource
relativePath IList
index int
return NodeSource
        protected virtual NodeSource Find(IList<QualifiedName> relativePath, int index)
        {
            // check for end of path.
            if (index < 0 || index >= relativePath.Count)
            {
                return null;
            }

            QualifiedName browseName = relativePath[index];
            
            // follow forward references to child.
            foreach (NodeSource child in m_children)
            {
                if (child.BrowseName != browseName)
                {
                    continue;
                }

                if (index == relativePath.Count-1)
                {
                    return child;
                }

                return child.Find(relativePath, ++index);
            }
                    
            // nothing found.
            return null;
        }