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

IsEncodingOf() public method

Checks if the identifier encodingId represents a that provides encodings for the datatypeId .
public IsEncodingOf ( ExpandedNodeId encodingId, ExpandedNodeId datatypeId ) : bool
encodingId ExpandedNodeId The id the encoding node .
datatypeId ExpandedNodeId The id of the DataType node.
return bool
        public bool IsEncodingOf(ExpandedNodeId encodingId, ExpandedNodeId datatypeId)
        {
            ILocalNode encoding = Find(encodingId) as ILocalNode;

            if (encoding == null)
            {
                return false;
            }
            
            foreach (IReference reference in encoding.References.Find(ReferenceTypeIds.HasEncoding, true, true, m_typeTree))
            {
                if (reference.TargetId == datatypeId)
                {
                    return true;
                }
            }

            // no match.
            return false;
        }