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

IsTypeOf() public method

Determines whether a type is a subtype of another type.
public IsTypeOf ( ExpandedNodeId subTypeId, ExpandedNodeId superTypeId ) : bool
subTypeId ExpandedNodeId The subtype identifier.
superTypeId ExpandedNodeId The supertype identifier.
return bool
        public bool IsTypeOf(ExpandedNodeId subTypeId, ExpandedNodeId superTypeId)
        {
            if (subTypeId == superTypeId)
            {
                return true;
            }

            ILocalNode subtype = Find(subTypeId) as ILocalNode;

            if (subtype == null)
            {
                return false;
            }

            ILocalNode supertype = subtype;

            while (supertype != null)
            {
                ExpandedNodeId currentId = supertype.References.FindTarget(ReferenceTypeIds.HasSubtype, true, true, m_typeTree, 0);

                if (currentId == superTypeId)
                {
                    return true;
                }

                supertype = Find(currentId) as ILocalNode;
            }
            
            return false;
        }

Same methods

NodeCache::IsTypeOf ( NodeId subTypeId, NodeId superTypeId ) : bool