Opc.Ua.TypeTable.IsTypeOf C# (CSharp) Method

IsTypeOf() public method

public IsTypeOf ( Opc.Ua.ExpandedNodeId subTypeId, Opc.Ua.ExpandedNodeId superTypeId ) : bool
subTypeId Opc.Ua.ExpandedNodeId
superTypeId Opc.Ua.ExpandedNodeId
return bool
        public bool IsTypeOf(ExpandedNodeId subTypeId, ExpandedNodeId superTypeId)
        {
            if (NodeId.IsNull(subTypeId) || subTypeId.ServerIndex != 0)
            {
                return false;
            }
            
            if (NodeId.IsNull(superTypeId) || superTypeId.ServerIndex != 0)
            {
                return false;
            }

            // check for exact match.
            if (subTypeId == superTypeId)
            {
                return true;
            }

            NodeId startId = ExpandedNodeId.ToNodeId(subTypeId, m_namespaceUris);
            
            if (startId == null)
            {
                return false;
            }

            NodeId targetId = ExpandedNodeId.ToNodeId(superTypeId, m_namespaceUris);
            
            if (targetId == null)
            {
                return false;
            }

            lock (m_lock)
            {
                TypeInfo typeInfo = null;

                if (!m_nodes.TryGetValue(startId, out typeInfo))
                {
                    return false;
                }

                return typeInfo.IsTypeOf(targetId);
            }
        }

Same methods

TypeTable::IsTypeOf ( Opc.Ua.NodeId subTypeId, Opc.Ua.NodeId superTypeId ) : bool