Opc.Ua.JsonDecoder.ReadNodeId C# (CSharp) Method

ReadNodeId() public method

Reads an NodeId from the stream.
public ReadNodeId ( string fieldName ) : Opc.Ua.NodeId
fieldName string
return Opc.Ua.NodeId
        public NodeId ReadNodeId(string fieldName)
        {
            object token = null;

            if (!ReadField(fieldName, out token))
            {
                return null;
            }

            var value = token as Dictionary<string,object>;

            if (value == null)
            {
                return null;
            }

            int index = -1;
            object uri = null;

            if (value.TryGetValue("Uri", out uri))
            {
                index = m_context.NamespaceUris.GetIndex(uri as string);
            }

            object id;

            if (!value.TryGetValue("Id", out id))
            {
                return null;
            }

            var nid = NodeId.Parse(id as string);

            if (index > 0)
            {
                if (m_namespaceMappings != null && index < m_namespaceMappings.Length)
                {
                    index = m_namespaceMappings[index];
                }
            }

            if (index > 0)
            {
                nid = new NodeId(nid.Identifier, (ushort)index);
            }

            return nid;
        }