Opc.Ua.Server.CoreNodeManager.GetNamespaceIndex C# (CSharp) Method

GetNamespaceIndex() public method

Returns an index for the NamespaceURI (Adds it to the server namespace table if it does not already exist).
Returns the server's default index (1) if the namespaceUri is empty or null.
public GetNamespaceIndex ( string namespaceUri ) : ushort
namespaceUri string
return ushort
        public ushort GetNamespaceIndex(string namespaceUri)
        {
            int namespaceIndex = 1;

            if (!String.IsNullOrEmpty(namespaceUri))
            {
                namespaceIndex = m_server.NamespaceUris.GetIndex(namespaceUri);

                if (namespaceIndex == -1)
                {
                    namespaceIndex = m_server.NamespaceUris.Append(namespaceUri);
                }
            }

            return (ushort)namespaceIndex;
        }