Opc.Ua.Com.Namespaces.GetNamespaceTable C# (CSharp) Method

GetNamespaceTable() public static method

Returns a namespace table with all of the URIs defined.
This table is was used to create any relative paths in the model design.
public static GetNamespaceTable ( ) : Opc.Ua.NamespaceTable
return Opc.Ua.NamespaceTable
        public static NamespaceTable GetNamespaceTable()
        {
            FieldInfo[] fields = typeof(Namespaces).GetFields(BindingFlags.Public | BindingFlags.Static);

            NamespaceTable namespaceTable = new NamespaceTable();

            foreach (FieldInfo field in fields)
            {
                string namespaceUri = (string)field.GetValue(typeof(Namespaces));

                if (namespaceTable.GetIndex(namespaceUri) == -1)
                {
                    namespaceTable.Append(namespaceUri);
                }
            }

            return namespaceTable;
        }
    }