Opc.Ua.Server.CoreNodeManager.FindInstanceDeclarationsInParent C# (CSharp) Method

FindInstanceDeclarationsInParent() private method

Recursively finds the instance declarations in the model parent that match the browse path.
private FindInstanceDeclarationsInParent ( ILocalNode node, List browsePath, List declarations ) : ILocalNode
node ILocalNode
browsePath List
declarations List
return ILocalNode
        private ILocalNode FindInstanceDeclarationsInParent(
            ILocalNode          node, 
            List<QualifiedName> browsePath, 
            List<ILocalNode>    declarations)
        {            
            if (node == null)
            {
                return null;
            }
            
            ILocalNode typeDefinition = GetLocalNode(node.TypeDefinitionId) as ILocalNode;
                        
            if (typeDefinition != null)
            {
                FindInstanceDeclarationsInType(typeDefinition, browsePath, declarations);
            }                       
            
            browsePath.Insert(0, node.BrowseName);

            IList<INode> parents = m_nodes.Find(node.NodeId, ReferenceTypeIds.HasModelParent, false, false);

            foreach (INode parent in parents)
            {
                return FindInstanceDeclarationsInParent(parent as ILocalNode, browsePath, declarations);
            }

            return node;
        }