Reference
OpcEnum Members
Defines an enumeration data type at runtime, e.g. to provide it by a server using Create.
Reference
OpcEnum Members
Properties
Id
Gets the identifier of the enumeration.
public OpcNodeId Id { get; }Public ReadOnly Property Id As OpcNodeIdProperty value
The identifier of the enumeration, or Null if none has been specified.
Implements
Name
Gets the name of the enumeration.
public OpcName Name { get; }Public ReadOnly Property Name As OpcNameProperty value
The name of the enumeration.
Implements
Type
Gets the way the members of the enumeration are described.
public OpcEnumType Type { get; }Public ReadOnly Property Type As OpcEnumTypeProperty value
Strings for an enumeration defined using one of the DefineStrings methods; otherwise Values.
Methods
CreateTypeInfo
Creates the type information of the enumeration using the context and the typeId specified.
public IOpcDataTypeInfo CreateTypeInfo(OpcContext context, OpcNodeId typeId)Public Function CreateTypeInfo(
context As OpcContext,
typeId As OpcNodeId) As IOpcDataTypeInfoParameters
| Name | Type | Description |
|---|---|---|
context | OpcContext | The context of the data type. |
typeId | OpcNodeId | The identifier of the data type to create. |
Returns
The type information of the enumeration.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The context or the typeId is a null reference ( |
Implements
DefineStrings
| Overload | Description |
|---|---|
| DefineStrings( | Defines an enumeration whose members are described by enumeration strings ( |
| DefineStrings( | Defines an enumeration whose members are described by enumeration strings ( |
| DefineStrings( | Defines an enumeration with the identifier specified whose members are described by enumeration strings ( |
| DefineStrings( | Defines an enumeration with the identifier specified whose members are described by enumeration strings ( |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Argument | The name or the fields or one of its elements is a null reference ( |
DefineStrings(OpcName, params OpcEnumField[])
Defines an enumeration whose members are described by enumeration strings (see Strings).
public static OpcEnum DefineStrings(OpcName name, params OpcEnumField[] fields)Public Shared Function DefineStrings(
name As OpcName,
ParamArray fields As OpcEnumField()) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
name | OpcName | The name of the enumeration. |
fields | params OpcEnumField[] | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
DefineStrings(OpcName, IEnumerable<OpcEnumField>)
Defines an enumeration whose members are described by enumeration strings (see Strings).
public static OpcEnum DefineStrings(
OpcName name,
IEnumerable<OpcEnumField> fields)Public Shared Function DefineStrings(
name As OpcName,
fields As IEnumerable(Of OpcEnumField)) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
name | OpcName | The name of the enumeration. |
fields | IEnumerable<OpcEnumField> | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
DefineStrings(OpcNodeId, OpcName, params OpcEnumField[])
Defines an enumeration with the identifier specified whose members are described by enumeration strings (see Strings).
public static OpcEnum DefineStrings(
OpcNodeId id,
OpcName name,
params OpcEnumField[] fields)Public Shared Function DefineStrings(
id As OpcNodeId,
name As OpcName,
ParamArray fields As OpcEnumField()) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
id | OpcNodeId | The identifier of the enumeration. |
name | OpcName | The name of the enumeration. |
fields | params OpcEnumField[] | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
DefineStrings(OpcNodeId, OpcName, IEnumerable<OpcEnumField>)
Defines an enumeration with the identifier specified whose members are described by enumeration strings (see Strings).
public static OpcEnum DefineStrings(
OpcNodeId id,
OpcName name,
IEnumerable<OpcEnumField> fields)Public Shared Function DefineStrings(
id As OpcNodeId,
name As OpcName,
fields As IEnumerable(Of OpcEnumField)) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
id | OpcNodeId | The identifier of the enumeration. |
name | OpcName | The name of the enumeration. |
fields | IEnumerable<OpcEnumField> | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
DefineValues
| Overload | Description |
|---|---|
| DefineValues( | Defines an enumeration whose members are described by enumeration values ( |
| DefineValues( | Defines an enumeration whose members are described by enumeration values ( |
| DefineValues( | Defines an enumeration with the identifier specified whose members are described by enumeration values ( |
| DefineValues( | Defines an enumeration with the identifier specified whose members are described by enumeration values ( |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Argument | The name or the fields or one of its elements is a null reference ( |
DefineValues(OpcName, params OpcEnumField[])
Defines an enumeration whose members are described by enumeration values (see Values).
public static OpcEnum DefineValues(OpcName name, params OpcEnumField[] fields)Public Shared Function DefineValues(
name As OpcName,
ParamArray fields As OpcEnumField()) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
name | OpcName | The name of the enumeration. |
fields | params OpcEnumField[] | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
DefineValues(OpcName, IEnumerable<OpcEnumField>)
Defines an enumeration whose members are described by enumeration values (see Values).
public static OpcEnum DefineValues(
OpcName name,
IEnumerable<OpcEnumField> fields)Public Shared Function DefineValues(
name As OpcName,
fields As IEnumerable(Of OpcEnumField)) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
name | OpcName | The name of the enumeration. |
fields | IEnumerable<OpcEnumField> | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
DefineValues(OpcNodeId, OpcName, params OpcEnumField[])
Defines an enumeration with the identifier specified whose members are described by enumeration values (see Values).
public static OpcEnum DefineValues(
OpcNodeId id,
OpcName name,
params OpcEnumField[] fields)Public Shared Function DefineValues(
id As OpcNodeId,
name As OpcName,
ParamArray fields As OpcEnumField()) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
id | OpcNodeId | The identifier of the enumeration. |
name | OpcName | The name of the enumeration. |
fields | params OpcEnumField[] | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
DefineValues(OpcNodeId, OpcName, IEnumerable<OpcEnumField>)
Defines an enumeration with the identifier specified whose members are described by enumeration values (see Values).
public static OpcEnum DefineValues(
OpcNodeId id,
OpcName name,
IEnumerable<OpcEnumField> fields)Public Shared Function DefineValues(
id As OpcNodeId,
name As OpcName,
fields As IEnumerable(Of OpcEnumField)) As OpcEnumParameters
| Name | Type | Description |
|---|---|---|
id | OpcNodeId | The identifier of the enumeration. |
name | OpcName | The name of the enumeration. |
fields | IEnumerable<OpcEnumField> | The fields of the enumeration. |
Returns
A new OpcEnum which defines the enumeration.
Remarks
A field defined without a value has the value of the field before it plus one, or zero if it is the first field, like a member of an enumeration in C#. The enumeration uses copies of the fields, so that the fields specified remain unchanged.
GetFields
Returns the fields of the enumeration.
public OpcEnumField[] GetFields()Public Function GetFields() As OpcEnumField()Returns
A new array of the fields in the order of their definition.
GetNames
Returns the names of the fields of the enumeration.
public string[] GetNames()Public Function GetNames() As String()Returns
String[]
The names of the fields in the order of their definition.
GetValues
| Overload | Description |
|---|---|
| GetValues< | Retrieves the enumeration values from the enumeration type specified T. |
| GetValues( | Retrieves the enumeration values from the enumeration type specified by enumType. |
| GetValues() | Returns the values of the fields of the enumeration. |
GetValues<T>()
Retrieves the enumeration values from the enumeration type specified T.
public static OpcEnumValue[] GetValues<T>()Public Shared Function GetValues(Of T)() As OpcEnumValue()Type parameters
| Name | Description |
|---|---|
T | The type of enumeration the values are to be retrieved from. |
Returns
An array of OpcEnumValue instances representing the values in the enumeration type specified by T.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The T is not an enumeration type. |
Remarks
The way how the enumeration values are determined and processed can be controlled using the OpcEnumAttribute. The way how the enumeration values are presented can be controlled using the OpcEnumMemberAttribute and EnumMemberAttribute.
GetValues(Type)
Retrieves the enumeration values from the enumeration type specified by enumType.
public static OpcEnumValue[] GetValues(Type enumType)Public Shared Function GetValues(enumType As Type) As OpcEnumValue()Parameters
| Name | Type | Description |
|---|---|---|
enumType | Type | The Type of enumeration its values are to be retrieved. |
Returns
An array of OpcEnumValue instances representing the values in the enumeration type specified by enumType.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The enumType is not an enumeration type. |
| Argument | The enumType is a null reference ( |
Remarks
The way how the enumeration values are determined and processed can be controlled using the OpcEnumAttribute. The way how the enumeration values are presented can be controlled using the OpcEnumMemberAttribute and EnumMemberAttribute.
GetValues()
Returns the values of the fields of the enumeration.
public long[] GetValues()Public Function GetValues() As Long()Returns
Int64[]
The values of the fields in the order of their definition.

