# OpcMemberLength Members

> Reference: Declares the total number of bytes or the number of instances of the type referenced by a member either direct or indirect by referencing a different member its value defines the length of the member.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcMemberLength</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>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Constructors

### OpcMemberLength

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

| Overload | Description |
|---|---|
| [OpcMemberLength(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/members#opcmemberlength-system-string) | Initializes a new instance of the [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/) class which refers to the length member using its `name` specified. |
| [OpcMemberLength(long)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/members#opcmemberlength-system-int64) | Initializes a new instance of the [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/) class which defines the total number of bytes or the number of instances of the type referenced by a member using the `value` specified. |

#### OpcMemberLength(string)

Initializes a new instance of the [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/) class which refers to the length member using its `name` specified. Using this constructor results in a [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/) which provides the length indirect using a different member using its `name`.

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

```csharp
public OpcMemberLength(string name)
```

</div>

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

```vbnet
Public Sub New(name As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the length member its value indicates the number of bytes or the number of instances of the type referenced by the member. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `name` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` is a null reference (Nothing in Visual Basic). |

#### OpcMemberLength(long)

Initializes a new instance of the [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/) class which defines the total number of bytes or the number of instances of the type referenced by a member using the `value` specified. Using this constructor results in a [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/) which provides the length direct using the `value` as the length.

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

```csharp
public OpcMemberLength(long value)
```

</div>

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

```vbnet
Public Sub New(value As Long)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [Int64](https://learn.microsoft.com/dotnet/api/system.int64) | The total number of bytes or the number of instances. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `value` is less than 0 or greater than [MaxValue](https://learn.microsoft.com/dotnet/api/system.int64.maxvalue). |

## Properties

### Name

Gets the name of the length member its value indicates the number of bytes or the number of instances.

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

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

</div>

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

```vbnet
Public ReadOnly Property Name As String
```

</div>

**Property value**

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

The [string](https://learn.microsoft.com/dotnet/api/system.string) which identifies the member its value indicates the length to use.

### Value

Gets the total number of bytes or the number of instances.

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

```csharp
public long Value { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Value As Long
```

</div>

**Property value**

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

The total number of bytes or the number of instances or -1 if the length is to be determined using the length member referenced by [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/members#name).

## Methods

### ToString

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

Returns a [string](https://learn.microsoft.com/dotnet/api/system.string) representing the information used by the current [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/).

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

```csharp
public override string ToString()
```

</div>

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

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

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

A [string](https://learn.microsoft.com/dotnet/api/system.string) representing the current [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/).

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)
