Opc.Ua.Server.DiagnosticsNodeManager.GetNamespaceIndex C# (CSharp) 메소드

GetNamespaceIndex() 공개 메소드

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
리턴 ushort
        public ushort GetNamespaceIndex(string namespaceUri)
        {
            int namespaceIndex = 1;

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

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

            return (ushort)namespaceIndex;
        }