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

BuildInstanceList() private method

Builds a table of instances indexed by browse path from the nodes aggregated by a parent
private BuildInstanceList ( ILocalNode parent, string browsePath, ILocalNode>.IDictionary instances ) : void
parent ILocalNode
browsePath string
instances ILocalNode>.IDictionary
return void
        private void BuildInstanceList(ILocalNode parent, string browsePath, IDictionary<string,ILocalNode> instances)
        { 
            if (parent == null) throw new ArgumentNullException("parent");
            if (instances == null) throw new ArgumentNullException("instances");
            
            // guard against loops.
            if (instances.ContainsKey(browsePath))
            {
                return;
            }

            // index parent by browse path.    
            instances[browsePath] = parent;

            // get list of children.
            IList<IReference> references = parent.References.Find(ReferenceTypeIds.HierarchicalReferences, false, true, m_nodes.TypeTree);

            foreach (IReference reference in references)
            {
                // find child (ignore children that are not in the node table).
                ILocalNode child = GetLocalNode(reference.TargetId) as ILocalNode;

                if (child == null)
                {
                    continue;
                }
                
                // recursively include aggregated children.
                BuildInstanceList(child, Utils.Format("{0}.{1}", browsePath, child.BrowseName), instances);
            }
        }
        #endregion