Opc.Ua.Client.NodeCache.FetchSuperTypes C# (CSharp) Method

FetchSuperTypes() public method

Adds the supertypes of the node to the cache.
public FetchSuperTypes ( ExpandedNodeId nodeId ) : void
nodeId ExpandedNodeId
return void
        public void FetchSuperTypes(ExpandedNodeId nodeId)
        {
            // find the target node,
            ILocalNode source = Find(nodeId) as ILocalNode;

            if (source == null)
            {
                return;
            }

            // follow the tree.
            ILocalNode subType = source;

            while (subType != null)
            {
                ILocalNode superType = null;

                IList<IReference> references = subType.References.Find(ReferenceTypeIds.HasSubtype, true, true, this);

                if (references != null && references.Count > 0)
                {
                    superType = Find(references[0].TargetId) as ILocalNode;
                }

                subType = superType;
            }
        }