Skip to content

Reference

OpcEnum Members

Defines an enumeration data type at runtime, e.g. to provide it by a server using Create.

Reference

OpcEnum Members ​

Type
OpcEnum
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Properties ​

Id ​

Gets the identifier of the enumeration.

csharp
public OpcNodeId Id { get; }
vbnet
Public ReadOnly Property Id As OpcNodeId

Property value

OpcNodeId

The identifier of the enumeration, or Null if none has been specified.

Implements

Id

Name ​

Gets the name of the enumeration.

csharp
public OpcName Name { get; }
vbnet
Public ReadOnly Property Name As OpcName

Property value

OpcName

The name of the enumeration.

Implements

Name

Type ​

Gets the way the members of the enumeration are described.

csharp
public OpcEnumType Type { get; }
vbnet
Public ReadOnly Property Type As OpcEnumType

Property value

OpcEnumType

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.

csharp
public IOpcDataTypeInfo CreateTypeInfo(OpcContext context, OpcNodeId typeId)
vbnet
Public Function CreateTypeInfo(
    context As OpcContext,
    typeId As OpcNodeId) As IOpcDataTypeInfo

Parameters

NameTypeDescription
contextOpcContextThe context of the data type.
typeIdOpcNodeIdThe identifier of the data type to create.

Returns

IOpcDataTypeInfo

The type information of the enumeration.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe context or the typeId is a null reference (Nothing in Visual Basic).

Implements

CreateTypeInfo

DefineStrings ​

static · 4 overloads

OverloadDescription
DefineStrings(OpcName, params OpcEnumField[])staticDefines an enumeration whose members are described by enumeration strings (see Strings).
DefineStrings(OpcName, IEnumerable<OpcEnumField>)staticDefines an enumeration whose members are described by enumeration strings (see Strings).
DefineStrings(OpcNodeId, OpcName, params OpcEnumField[])staticDefines an enumeration with the identifier specified whose members are described by enumeration strings (see Strings).
DefineStrings(OpcNodeId, OpcName, IEnumerable<OpcEnumField>)staticDefines an enumeration with the identifier specified whose members are described by enumeration strings (see Strings).

Exceptions (all overloads)

ExceptionCondition
ArgumentNullExceptionThe name or the fields or one of its elements is a null reference (Nothing in Visual Basic).

DefineStrings(OpcName, params OpcEnumField[]) ​

static

Defines an enumeration whose members are described by enumeration strings (see Strings).

csharp
public static OpcEnum DefineStrings(OpcName name, params OpcEnumField[] fields)
vbnet
Public Shared Function DefineStrings(
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum

Parameters

NameTypeDescription
nameOpcNameThe name of the enumeration.
fieldsparams OpcEnumField[]The fields of the enumeration.

Returns

OpcEnum

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>) ​

static

Defines an enumeration whose members are described by enumeration strings (see Strings).

csharp
public static OpcEnum DefineStrings(
    OpcName name,
    IEnumerable<OpcEnumField> fields)
vbnet
Public Shared Function DefineStrings(
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum

Parameters

NameTypeDescription
nameOpcNameThe name of the enumeration.
fieldsIEnumerable<OpcEnumField>The fields of the enumeration.

Returns

OpcEnum

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[]) ​

static

Defines an enumeration with the identifier specified whose members are described by enumeration strings (see Strings).

csharp
public static OpcEnum DefineStrings(
    OpcNodeId id,
    OpcName name,
    params OpcEnumField[] fields)
vbnet
Public Shared Function DefineStrings(
    id As OpcNodeId,
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the enumeration.
nameOpcNameThe name of the enumeration.
fieldsparams OpcEnumField[]The fields of the enumeration.

Returns

OpcEnum

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>) ​

static

Defines an enumeration with the identifier specified whose members are described by enumeration strings (see Strings).

csharp
public static OpcEnum DefineStrings(
    OpcNodeId id,
    OpcName name,
    IEnumerable<OpcEnumField> fields)
vbnet
Public Shared Function DefineStrings(
    id As OpcNodeId,
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the enumeration.
nameOpcNameThe name of the enumeration.
fieldsIEnumerable<OpcEnumField>The fields of the enumeration.

Returns

OpcEnum

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 ​

static · 4 overloads

OverloadDescription
DefineValues(OpcName, params OpcEnumField[])staticDefines an enumeration whose members are described by enumeration values (see Values).
DefineValues(OpcName, IEnumerable<OpcEnumField>)staticDefines an enumeration whose members are described by enumeration values (see Values).
DefineValues(OpcNodeId, OpcName, params OpcEnumField[])staticDefines an enumeration with the identifier specified whose members are described by enumeration values (see Values).
DefineValues(OpcNodeId, OpcName, IEnumerable<OpcEnumField>)staticDefines an enumeration with the identifier specified whose members are described by enumeration values (see Values).

Exceptions (all overloads)

ExceptionCondition
ArgumentNullExceptionThe name or the fields or one of its elements is a null reference (Nothing in Visual Basic).

DefineValues(OpcName, params OpcEnumField[]) ​

static

Defines an enumeration whose members are described by enumeration values (see Values).

csharp
public static OpcEnum DefineValues(OpcName name, params OpcEnumField[] fields)
vbnet
Public Shared Function DefineValues(
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum

Parameters

NameTypeDescription
nameOpcNameThe name of the enumeration.
fieldsparams OpcEnumField[]The fields of the enumeration.

Returns

OpcEnum

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>) ​

static

Defines an enumeration whose members are described by enumeration values (see Values).

csharp
public static OpcEnum DefineValues(
    OpcName name,
    IEnumerable<OpcEnumField> fields)
vbnet
Public Shared Function DefineValues(
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum

Parameters

NameTypeDescription
nameOpcNameThe name of the enumeration.
fieldsIEnumerable<OpcEnumField>The fields of the enumeration.

Returns

OpcEnum

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[]) ​

static

Defines an enumeration with the identifier specified whose members are described by enumeration values (see Values).

csharp
public static OpcEnum DefineValues(
    OpcNodeId id,
    OpcName name,
    params OpcEnumField[] fields)
vbnet
Public Shared Function DefineValues(
    id As OpcNodeId,
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the enumeration.
nameOpcNameThe name of the enumeration.
fieldsparams OpcEnumField[]The fields of the enumeration.

Returns

OpcEnum

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>) ​

static

Defines an enumeration with the identifier specified whose members are described by enumeration values (see Values).

csharp
public static OpcEnum DefineValues(
    OpcNodeId id,
    OpcName name,
    IEnumerable<OpcEnumField> fields)
vbnet
Public Shared Function DefineValues(
    id As OpcNodeId,
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the enumeration.
nameOpcNameThe name of the enumeration.
fieldsIEnumerable<OpcEnumField>The fields of the enumeration.

Returns

OpcEnum

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.

csharp
public OpcEnumField[] GetFields()
vbnet
Public Function GetFields() As OpcEnumField()

Returns

OpcEnumField[]

A new array of the fields in the order of their definition.

GetNames ​

Returns the names of the fields of the enumeration.

csharp
public string[] GetNames()
vbnet
Public Function GetNames() As String()

Returns

String[]

The names of the fields in the order of their definition.

GetValues ​

3 overloads

OverloadDescription
GetValues<T>()staticRetrieves the enumeration values from the enumeration type specified T.
GetValues(Type)staticRetrieves the enumeration values from the enumeration type specified by enumType.
GetValues()Returns the values of the fields of the enumeration.

GetValues<T>() ​

static

Retrieves the enumeration values from the enumeration type specified T.

csharp
public static OpcEnumValue[] GetValues<T>()
vbnet
Public Shared Function GetValues(Of T)() As OpcEnumValue()

Type parameters

NameDescription
TThe type of enumeration the values are to be retrieved from.

Returns

OpcEnumValue[]

An array of OpcEnumValue instances representing the values in the enumeration type specified by T.

Exceptions

ExceptionCondition
ArgumentExceptionThe 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) ​

static

Retrieves the enumeration values from the enumeration type specified by enumType.

csharp
public static OpcEnumValue[] GetValues(Type enumType)
vbnet
Public Shared Function GetValues(enumType As Type) As OpcEnumValue()

Parameters

NameTypeDescription
enumTypeTypeThe Type of enumeration its values are to be retrieved.

Returns

OpcEnumValue[]

An array of OpcEnumValue instances representing the values in the enumeration type specified by enumType.

Exceptions

ExceptionCondition
ArgumentExceptionThe enumType is not an enumeration type.
ArgumentNullExceptionThe enumType is a null reference (Nothing in Visual Basic).

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.

csharp
public long[] GetValues()
vbnet
Public Function GetValues() As Long()

Returns

Int64[]

The values of the fields in the order of their definition.