# OpcEnum Members

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

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcEnum</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

## Properties

### Id

Gets the identifier of the enumeration.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeId Id { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Id As OpcNodeId
```

</div>

**Property value**

[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)

The identifier of the enumeration, or [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) if none has been specified.

**Implements**

[Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypebuilder/members#id)

### Name

Gets the name of the enumeration.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcName Name { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Name As OpcName
```

</div>

**Property value**

[OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/)

The name of the enumeration.

**Implements**

[Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypebuilder/members#name)

### Type

Gets the way the members of the enumeration are described.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEnumType Type { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Type As OpcEnumType
```

</div>

**Property value**

[OpcEnumType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/)

[Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings) for an enumeration defined using one of the DefineStrings methods; otherwise [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values).

## Methods

### CreateTypeInfo

Creates the type information of the enumeration using the `context` and the `typeId` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public IOpcDataTypeInfo CreateTypeInfo(OpcContext context, OpcNodeId typeId)
```

</div>

<div class="api-signature" data-lang="vbnet">

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The context of the data type. |
| `typeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the data type to create. |

**Returns**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

The type information of the enumeration.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `context` or the `typeId` is a null reference (Nothing in Visual Basic). |

**Implements**

[CreateTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypebuilder/members#createtypeinfo)

### DefineStrings

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [DefineStrings(OpcName, params OpcEnumField\[\])](#definestrings-opc-uafx-opcname-opc-uafx-opcenumfield-array)<span class="api-meta">static</span> | Defines an enumeration whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)). |
| [DefineStrings(OpcName, IEnumerable&lt;OpcEnumField&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/members#definestrings-opc-uafx-opcname-system-collections-generic-ienumerable-of-opc-uafx-opcenumfield)<span class="api-meta">static</span> | Defines an enumeration whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)). |
| [DefineStrings(OpcNodeId, OpcName, params OpcEnumField\[\])](#definestrings-opc-uafx-opcnodeid-opc-uafx-opcname-opc-uafx-opcenumfield-array)<span class="api-meta">static</span> | Defines an enumeration with the identifier specified whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)). |
| [DefineStrings(OpcNodeId, OpcName, IEnumerable&lt;OpcEnumField&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/members#definestrings-opc-uafx-opcnodeid-opc-uafx-opcname-system-collections-generic-ienumerable-of-opc-uafx-opcenumfield)<span class="api-meta">static</span> | Defines an enumeration with the identifier specified whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` or the `fields` or one of its elements is a null reference (Nothing in Visual Basic). |

#### DefineStrings(OpcName, params OpcEnumField\[\])

<span class="api-meta">static</span>

Defines an enumeration whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineStrings(OpcName name, params OpcEnumField[] fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineStrings(
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | params [OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)[] | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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&lt;OpcEnumField&gt;)

<span class="api-meta">static</span>

Defines an enumeration whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineStrings(
    OpcName name,
    IEnumerable<OpcEnumField> fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineStrings(
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)&gt; | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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\[\])

<span class="api-meta">static</span>

Defines an enumeration with the identifier specified whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineStrings(
    OpcNodeId id,
    OpcName name,
    params OpcEnumField[] fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineStrings(
    id As OpcNodeId,
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the enumeration. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | params [OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)[] | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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&lt;OpcEnumField&gt;)

<span class="api-meta">static</span>

Defines an enumeration with the identifier specified whose members are described by enumeration strings (see [Strings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#strings)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineStrings(
    OpcNodeId id,
    OpcName name,
    IEnumerable<OpcEnumField> fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineStrings(
    id As OpcNodeId,
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the enumeration. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)&gt; | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [DefineValues(OpcName, params OpcEnumField\[\])](#definevalues-opc-uafx-opcname-opc-uafx-opcenumfield-array)<span class="api-meta">static</span> | Defines an enumeration whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)). |
| [DefineValues(OpcName, IEnumerable&lt;OpcEnumField&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/members#definevalues-opc-uafx-opcname-system-collections-generic-ienumerable-of-opc-uafx-opcenumfield)<span class="api-meta">static</span> | Defines an enumeration whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)). |
| [DefineValues(OpcNodeId, OpcName, params OpcEnumField\[\])](#definevalues-opc-uafx-opcnodeid-opc-uafx-opcname-opc-uafx-opcenumfield-array)<span class="api-meta">static</span> | Defines an enumeration with the identifier specified whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)). |
| [DefineValues(OpcNodeId, OpcName, IEnumerable&lt;OpcEnumField&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/members#definevalues-opc-uafx-opcnodeid-opc-uafx-opcname-system-collections-generic-ienumerable-of-opc-uafx-opcenumfield)<span class="api-meta">static</span> | Defines an enumeration with the identifier specified whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` or the `fields` or one of its elements is a null reference (Nothing in Visual Basic). |

#### DefineValues(OpcName, params OpcEnumField\[\])

<span class="api-meta">static</span>

Defines an enumeration whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineValues(OpcName name, params OpcEnumField[] fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineValues(
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | params [OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)[] | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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&lt;OpcEnumField&gt;)

<span class="api-meta">static</span>

Defines an enumeration whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineValues(
    OpcName name,
    IEnumerable<OpcEnumField> fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineValues(
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)&gt; | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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\[\])

<span class="api-meta">static</span>

Defines an enumeration with the identifier specified whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineValues(
    OpcNodeId id,
    OpcName name,
    params OpcEnumField[] fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineValues(
    id As OpcNodeId,
    name As OpcName,
    ParamArray fields As OpcEnumField()) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the enumeration. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | params [OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)[] | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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&lt;OpcEnumField&gt;)

<span class="api-meta">static</span>

Defines an enumeration with the identifier specified whose members are described by enumeration values (see [Values](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumtype/#values)).

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnum DefineValues(
    OpcNodeId id,
    OpcName name,
    IEnumerable<OpcEnumField> fields)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function DefineValues(
    id As OpcNodeId,
    name As OpcName,
    fields As IEnumerable(Of OpcEnumField)) As OpcEnum
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the enumeration. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The name of the enumeration. |
| `fields` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)&gt; | The fields of the enumeration. |

**Returns**

[OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/)

A new [OpcEnum](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEnumField[] GetFields()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetFields() As OpcEnumField()
```

</div>

**Returns**

[OpcEnumField](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumfield/)[]

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

### GetNames

Returns the names of the fields of the enumeration.

<div class="api-signature" data-lang="csharp">

```csharp
public string[] GetNames()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetNames() As String()
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)[]

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

### GetValues

<span class="api-meta">3 overloads</span>

| Overload | Description |
|---|---|
| [GetValues&lt;T&gt;()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/members#getvalues-t1)<span class="api-meta">static</span> | Retrieves the enumeration values from the enumeration type specified `T`. |
| [GetValues(Type)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/members#getvalues-system-type)<span class="api-meta">static</span> | Retrieves the enumeration values from the enumeration type specified by `enumType`. |
| [GetValues()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenum/members#getvalues-noparams) | Returns the values of the fields of the enumeration. |

#### GetValues&lt;T&gt;()

<span class="api-meta">static</span>

Retrieves the enumeration values from the enumeration type specified `T`.

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnumValue[] GetValues<T>()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function GetValues(Of T)() As OpcEnumValue()
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type of enumeration the values are to be retrieved from. |

**Returns**

[OpcEnumValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumvalue/)[]

An array of [OpcEnumValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumvalue/) instances representing the values in the enumeration type specified by `T`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `T` is not an enumeration type. |

**Remarks**

The way how the enumeration values are determined and processed can be controlled using the [OpcEnumAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumattribute/). The way how the enumeration values are presented can be controlled using the [OpcEnumMemberAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenummemberattribute/) and [EnumMemberAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.enummemberattribute).

#### GetValues(Type)

<span class="api-meta">static</span>

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

<div class="api-signature" data-lang="csharp">

```csharp
public static OpcEnumValue[] GetValues(Type enumType)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function GetValues(enumType As Type) As OpcEnumValue()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `enumType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) of enumeration its values are to be retrieved. |

**Returns**

[OpcEnumValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumvalue/)[]

An array of [OpcEnumValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumvalue/) instances representing the values in the enumeration type specified by `enumType`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `enumType` is not an enumeration type. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenumattribute/). The way how the enumeration values are presented can be controlled using the [OpcEnumMemberAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcenummemberattribute/) and [EnumMemberAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.enummemberattribute).

#### GetValues()

Returns the values of the fields of the enumeration.

<div class="api-signature" data-lang="csharp">

```csharp
public long[] GetValues()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetValues() As Long()
```

</div>

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)[]

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