Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcNamespace type exposes the following members.
Gets the default namespace used in cases there the concrete does not matter or is just unknown.
C#
public static OpcNamespace Default { get; }
Property Value
An instance of the OpcNamespace class its IsDefault property always returns the value true. While its Index property is equals to zero, its Uri and Value properties always return a null reference (Nothing in Visual Basic).
Gets the index of the namespace within all namespaces of a server.
C#
public int Index { get; }
Property Value
The index value which refers to the namespace in the namespace array of the server this OpcNamespace represents.
Remarks
The available namespaces of a server can be retrieved through reading the value of the namespaces-node using the node identifier 'OpcObjectTypes.Server.Namespaces'.
Gets a value indicating whether the namespace defines the default namespace without to refer to a specific address space.
C#
public bool IsDefault { get; }
Property Value
The value true if the namespace points to the generic address space; otherwise the value false if the namespace points to a foundation or user defined address space.
Gets a value indicating whether the namespace is resolved regarding its Index, Uri and Value.
C#
public bool IsResolved { get; }
Property Value
The value true if Index is not equals zero and Uri and Value are not a null reference (Nothing in Visual Basic).
Remarks
In case there this property provides the value true any call to Resolve(IOpcNamespaceResolver) will have no effect to the Index nor to the Uri and Value properties.
Gets scope within the current OpcNamespace has been declared and its metadata applies to.
C#
public OpcNamespaceScope Scope { get; }
Property Value
One of the members defined by the OpcNamespaceScope enumeration.
Gets the uniform resource identifier (URI) of the namespace represented and referred to by the Index.
C#
public Uri Uri { get; }
Property Value
The Uri to that the OpcNamespace refers using the Index.
Gets the intrinsic value of the namespace represented and referred to by the Index.
C#
public string Value { get; }
Property Value
The String to that the OpcNamespace refers using the Index.
Empties the known namespaces.
C#
public static void Clear()
Remarks
All namespaces retrieved until Clear is called are no longer referenced by the global / static namespace cache. Any so far retrieved namespaces are kept resolved / existing / valid and kept unchanged by subsequent global namespace operations, because they are not longer tracked nor updated by further global namespace retrieval nor resolve operations.
Compares the current OpcNamespace with the other
.
C#
public int CompareTo(object other)
Parameters
other
Object
The OpcNamespace to compare with this OpcNamespace.
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(Object)).
Compares the current OpcNamespace with another OpcNamespace.
C#
public int CompareTo(OpcNamespace other)
Parameters
other
OpcNamespace
The OpcNamespace to compare with this OpcNamespace.
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(0)).
Creates a OpcNamespace using the value
specified.
C#
public static OpcNamespace Create(string value)
Parameters
value
String
The String value or a null reference (Nothing in Visual Basic) of the namespace to represent.
Returns
An instance of the OpcNamespace class.
Creates a OpcNamespace using the value
and index
specified.
C#
public static OpcNamespace Create(string value, int index)
Parameters
value
String
The String value or a null reference (Nothing in Visual Basic) of the namespace to represent and referred to by the index
.
index
Int32
The positive number which identifies the namespace. A value within the range of zero to MaxValue.
Returns
An instance of the OpcNamespace class.
Exceptions
The index
is less than zero or greater than MaxValue.
Creates a OpcNamespace from the Uri specified. If uri
provides Port information, the Port is used for the Index of the OpcNamespace created.
C#
public static OpcNamespace Create(Uri uri)
Parameters
uri
Uri
A Uri that contains a namespace.
Returns
An instance of the OpcNamespace class.
Exceptions
The uri
is a null reference (Nothing in Visual Basic).
The uri
is not a valid namespace.
Creates a OpcNamespace from the Uri specified. If uri
provides Port information, the Port is used for the Index of the OpcNamespace created, if index
not greater than zero.
C#
public static OpcNamespace Create(Uri uri, int index)
Parameters
uri
Uri
A Uri that contains a namespace.
index
Int32
The positive number which identifies the namespace. A value within the range of zero to MaxValue.
Returns
An instance of the OpcNamespace class.
Exceptions
The uri
is a null reference (Nothing in Visual Basic).
The index
is less than zero or greater than MaxValue.
The uri
is not a valid namespace.
Determines whether the specified other
is equal to this OpcNamespace.
C#
public override bool Equals(object other)
Parameters
other
Object
The OpcNamespace to compare to the current OpcNamespace.
Returns
The value true if the specified OpcNamespace is equal to the current OpcNamespace; otherwise the value false.
Determines whether the specified other
is equal to this OpcNamespace.
C#
public bool Equals(OpcNamespace other)
Parameters
other
OpcNamespace
The OpcNamespace to compare to the current OpcNamespace.
Returns
The value true if the specified OpcNamespace is equal to the current OpcNamespace; otherwise the value false.
Retrieves the OpcNamespace known under the namespaceIndex
specified.
C#
public static OpcNamespace Get(int namespaceIndex)
Parameters
namespaceIndex
Int32
The index of the OpcNamespace to retrieve.
Returns
If namespaceIndex
is equals zero the Default namespace; otherwise if there is a known namespace with the index specified the reference to the existing OpcNamespace. If there does no namespace exist under the index specified by namespaceIndex
a new namespace with that index is created, added to the indexed namespaces and the reference to the new OpcNamespace is returned.
Retrieves the OpcNamespace known under the namespaceIndex
and namespaceValue
specified.
C#
public static OpcNamespace Get(int namespaceIndex, string namespaceValue)
Parameters
namespaceIndex
Int32
The index of the OpcNamespace to retrieve.
namespaceValue
String
The Uri-formatted or String-based representation of the OpcNamespace to retrieve.
Returns
If namespaceIndex
is equals zero and the Port portion of the namespaceValue
is zero too the Default namespace; otherwise if there is a known namespace with the index specified by namespaceIndex
or (if this parameter is equals zero) a known namespace with the index defined by the Port portion of the namespaceValue
the reference to the existing OpcNamespace. If there does no namespace exist under the index and value specified by namespaceIndex
and namespaceValue
a new namespace with that index and value is created, added to the indexed / unindexed namespaces and the reference to the new OpcNamespace is returned.
Exceptions
The namespaceValue
is an empty string.
The namespaceValue
is a null reference (Nothing in Visual Basic).
The namespaceValue
is not a valid namespace.
Retrieves the OpcNamespace known under the namespaceIndex
and namespaceUri
specified.
C#
public static OpcNamespace Get(int namespaceIndex, Uri namespaceUri)
Parameters
namespaceIndex
Int32
The index of the OpcNamespace to retrieve.
namespaceUri
Uri
The Uri of the OpcNamespace to retrieve.
Returns
If namespaceIndex
is equals zero and the Port portion of the namespaceUri
is zero too the Default namespace; otherwise if there is a known namespace with the index specified by namespaceIndex
or (if this parameter is equals zero) a known namespace with the index defined by the Port portion of the namespaceUri
the reference to the existing OpcNamespace. If there does no namespace exist under the index and uri specified by namespaceIndex
and namespaceUri
a new namespace with that index and uri is created, added to the indexed / unindexed namespaces and the reference to the new OpcNamespace is returned.
Exceptions
The namespaceUri
is a null reference (Nothing in Visual Basic).
The namespaceUri
is not a valid namespace.
Retrieves the OpcNamespace using the information provided by the namespaceUriOrValue
specified.
C#
public static OpcNamespace Get(string namespaceUriOrValue)
Parameters
namespaceUriOrValue
String
The String-based representation or Uri-formatted string of the OpcNamespace to retrieve.
Returns
If Host portion of the namespaceUriOrValue
is equals to UriHost and the Port does not refer to an indexed namespace the Default namespace; otherwise if there is a known namespace with the index specified by the Port portion the reference to the existing OpcNamespace. If there does no namespace exist under the index or namespaceUriOrValue
specified a new namespace with that Uri is created, added to the indexed / unindexed namespaces and the reference to the new OpcNamespace is returned.
Exceptions
The namespaceUriOrValue
is an empty string.
The namespaceUriOrValue
is a null reference (Nothing in Visual Basic).
The namespaceUriOrValue
is not a valid namespace.
Retrieves the OpcNamespace with the information provided by the namespaceUri
specified.
C#
public static OpcNamespace Get(Uri namespaceUri)
Parameters
namespaceUri
Uri
The Uri of the OpcNamespace to retrieve.
Returns
If Host portion of the namespaceUri
is equals to UriHost and the Port does not refer to an indexed namespace the Default namespace; otherwise if there is a known namespace with the index specified by the Port portion the reference to the existing OpcNamespace. If there does no namespace exist under the index or namespaceUri
specified a new namespace with that Uri is created, added to the indexed / unindexed namespaces and the reference to the new OpcNamespace is returned.
Exceptions
The namespaceUri
is a null reference (Nothing in Visual Basic).
Retrieves a hash code for this OpcNamespace.
C#
public override int GetHashCode()
Returns
An Int32 that contains the hash code for the OpcNamespace.
Retrieves a new OpcNodeId using the opaque value
and this OpcNamespace.
C#
public OpcNodeId GetId(byte[] value)
Parameters
value
Byte[]
The opaque value of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value and this OpcNamespace as the Namespace.
Retrieves a new OpcNodeId using the general unique identifier (= GUID) value
and this OpcNamespace.
C#
public OpcNodeId GetId(Guid value)
Parameters
value
Guid
The general unique identifier (= GUID) value of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value and this OpcNamespace as the Namespace.
Retrieves a new OpcNodeId using the numeric value
and this OpcNamespace.
C#
public OpcNodeId GetId(int value)
Parameters
value
Int32
The numeric value of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value and this OpcNamespace as the Namespace.
Retrieves a new OpcNodeId using the value
and this OpcNamespace.
C#
public OpcNodeId GetId(object value)
Parameters
value
Object
The value of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value and this OpcNamespace as the Namespace.
Exceptions
The type of value
is not supported.
Retrieves a new OpcNodeId using the Stringvalue
and this OpcNamespace.
C#
public OpcNodeId GetId(string value)
Parameters
value
String
The String value of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value and this OpcNamespace as the Namespace.
Retrieves a new OpcNodeId using the Stringvalue
, this OpcNamespace and the pathElements
.
C#
public OpcNodeId GetId(string value, params OpcName[] pathElements)
Parameters
value
String
The String value of the identifier.
pathElements
OpcName[]
The elements of the OpcNamePath to use as the logical (= physically not available in the address space) portion of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value, this OpcNamespace as the Namespace and the pathElements
for the Path.
Retrieves a new OpcNodeId using the Stringvalue
, this OpcNamespace and the path
.
C#
public OpcNodeId GetId(string value, OpcNamePath path)
Parameters
value
String
The String value of the identifier.
path
OpcNamePath
The logical (= physically not available in the address space) portion of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value, this OpcNamespace as the Namespace and the path
specified for the Path.
Retrieves a new OpcNodeId using the numeric value
and this OpcNamespace.
C#
public OpcNodeId GetId(uint value)
Parameters
value
UInt32
The numeric value of the identifier.
Returns
A new instance of the OpcNodeId using the value
as the identifier value and this OpcNamespace as the Namespace.
Retrieves a new OpcName using the name
and this OpcNamespace.
C#
public OpcName GetName(string name)
Parameters
name
String
The value of the OpcName to create.
Returns
A new instance of the OpcName using the name
as the Value and this OpcNamespace as the Namespace.
Converts a namespace string to a OpcNamespace instance.
C#
public static OpcNamespace Parse(string value)
Parameters
value
String
A string that contains a namespace.
Returns
An instance of the OpcNamespace class.
Exceptions
The value
is not a valid namespace.
Resolves missing OPC UA namespace information using the object specified by resolver
.
C#
public void Resolve(IOpcNamespaceResolver resolver)
Parameters
resolver
IOpcNamespaceResolver
An instance implementing the IOpcNamespaceResolver interface to use to retrieve additional namespace information so far missed by the OpcNamespace.
Exceptions
The resolver
is a null reference (Nothing in Visual Basic).
Remarks
Only missing information is resolved using the resolver
specified. A once resolved Index or Value is not discarded or re-resolved by subsequent calls of this method (see IsResolved).
Determines whether a Uri is a valid namespace.
C#
public static bool TryCreate(Uri uri, int index, out OpcNamespace nodeNamespace)
Parameters
uri
Uri
The Uri to validate.
index
Int32
The index which applies to the uri
of the namespace to validate.
nodeNamespace
OpcNamespace
The OpcNamespace version of the uri
with the index
specified.
Returns
The value true; if the uri
is a valid namespace; otherwise the value false.
Remarks
The index
is only used if it is greater than zero; otherwise the Port of the uri
is used instead.
Determines whether a Uri is a valid namespace.
C#
public static bool TryCreate(Uri uri, out OpcNamespace nodeNamespace)
Parameters
uri
Uri
The Uri to validate.
nodeNamespace
OpcNamespace
The OpcNamespace version of the uri
.
Returns
The value true, if the uri
is a valid namespace; otherwise the value false.
Determines whether a string is a valid namespace.
C#
public static bool TryParse(string value, out OpcNamespace nodeNamespace)
Parameters
value
String
The string to validate.
nodeNamespace
OpcNamespace
The OpcNamespace version of the string.
Returns
The value true, if value
is a valid namespace; otherwise the value false.
Returns a value indicating whether two instance of OpcNamespace are equal.
C#
public static bool operator ==(OpcNamespace left, OpcNamespace right)
Determines whether the first specified OpcNamespace object is greater than the second specified OpcNamespace object.
C#
public static bool operator>(OpcNamespace left, OpcNamespace right)
Determines whether the first specified OpcNamespace object is greater than or equal to the second specified OpcNamespace object.
C#
public static bool operator >=(OpcNamespace left, OpcNamespace right)
Converts a Int32 to an OpcNamespace object.
C#
public static implicit operator OpcNamespace(int value)
Converts a String to an OpcNamespace object.
C#
public static implicit operator OpcNamespace(string value)
Returns a value indicating whether two instances of OpcNamespace are not equal.
C#
public static bool operator !=(OpcNamespace left, OpcNamespace right)
Determines whether the first specified OpcNamespace object is less than the second specified OpcNamespace object.
C#
public static bool operator <(OpcNamespace left, OpcNamespace right)
Exceptions
The left
is a null reference (Nothing in Visual Basic).
Determines whether the first specified OpcNamespace object is less than or equal to the second OpcNamespace object.
C#
public static bool operator <=(OpcNamespace left, OpcNamespace right)
Exceptions
The left
is a null reference (Nothing in Visual Basic).