# OpcRange Members

> Reference: Represents a range used to identify a single element or a range of elements in a structure or an array using their zero-based indexes.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcRange</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

### OpcRange

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

| Overload | Description |
|---|---|
| [OpcRange(int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#opcrange-system-int32) | Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` index of a single element. |
| [OpcRange(int, OpcRange)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#opcrange-system-int32-opc-uafx-opcrange) | Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` index of a single element in the first dimension used for the `next` range. |
| [OpcRange(int, int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#opcrange-system-int32-system-int32) | Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` and `end` index of a range of elements. |
| [OpcRange(int, int, OpcRange)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#opcrange-system-int32-system-int32-opc-uafx-opcrange) | Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` and `end` index of a range of elements in the first dimension used for the `next` range. |

#### OpcRange(int)

Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` index of a single element.

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

```csharp
public OpcRange(int start)
```

</div>

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

```vbnet
Public Sub New(start As Integer)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `start` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The index of a single element to identify. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `start` is less than zero. |

#### OpcRange(int, OpcRange)

Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` index of a single element in the first dimension used for the `next` range.

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

```csharp
public OpcRange(int start, OpcRange next)
```

</div>

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

```vbnet
Public Sub New(start As Integer, [next] As OpcRange)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `start` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The index of a single element in the first dimension. |
| `next` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) for the next dimension. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `start` is less than zero. |

#### OpcRange(int, int)

Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` and `end` index of a range of elements.

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

```csharp
public OpcRange(int start, int end)
```

</div>

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

```vbnet
Public Sub New(start As Integer, [end] As Integer)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `start` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the first element in the range. |
| `end` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the last element in the range. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `start` is not less than `end`. |
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `start` or `end` is less than zero. |

#### OpcRange(int, int, OpcRange)

Initializes a new instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the specified `start` and `end` index of a range of elements in the first dimension used for the `next` range.

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

```csharp
public OpcRange(int start, int end, OpcRange next)
```

</div>

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

```vbnet
Public Sub New(start As Integer, [end] As Integer, [next] As OpcRange)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `start` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the first element in the first dimension. |
| `end` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the last element in the first dimension. |
| `next` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) for the next dimension. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `start` is not less than `end`. |
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `start` or `end` is less than zero. |

## Fields

### Empty

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

Stores the value used to identify an undefined [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public static readonly OpcRange Empty
```

</div>

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

```vbnet
Public Shared ReadOnly Empty As OpcRange
```

</div>

**Field value**

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

**Remarks**

Do not use <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange.Empty">Empty</abbr>, because the foundations definition of empty does not support the 'default' value of a struct accordingly. This means the <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange.Empty">Empty</abbr> uses the value -1 for the [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) and [End](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#end) properties. However this can only be assured in case the user uses <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange.Empty">Empty</abbr> (or [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#empty) with this value). To assure that the 'real' default value results into a 'not used/considered' [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) we've decided to use our own definition of [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#empty) using the default value zero for [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) and [End](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#end) to assure that the default value of a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) matches the definition of [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#empty).

## Properties

### Dimensions

Gets the total number of dimensions identified by this and its subsequent [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) values (see [Next](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#next)).

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

```csharp
public int Dimensions { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Dimensions As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The total number of dimensions identified by this and its subsequent [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) values (see [Next](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#next)).

### End

Gets the index of the last element in the range.

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

```csharp
public int End { get; }
```

</div>

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

```vbnet
Public ReadOnly Property [End] As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The zero-based index of the last element in the range.

### Length

Gets the total number of elements identified by this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public int Length { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Length As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The total number of elements identified from [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) to [End](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#end) by this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

### Next

Gets the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) for the next dimension within this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public OpcRange Next { get; }
```

</div>

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

```vbnet
Public ReadOnly Property [Next] As OpcRange
```

</div>

**Property value**

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

A [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) identifying a single element or a range of elements in the next dimension or [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#empty) if there is no subsequent range defined.

### Start

Gets the index of the first element in the range.

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

```csharp
public int Start { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Start As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The zero-based index of the first element in the range.

## Methods

### CompareTo

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

| Overload | Description |
|---|---|
| [CompareTo(object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#compareto-system-object) | Compares the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the `other`. |
| [CompareTo(OpcRange)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#compareto-opc-uafx-opcrange) | Compares the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with another [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |

#### CompareTo(object)

Compares the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with the `other`.

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

```csharp
public int CompareTo(object other)
```

</div>

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

```vbnet
Public Function CompareTo(other As Object) As Integer
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `other` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare with this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |

**Returns**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

A 32-bit signed integer that indicates the relative order of the objects being compared ([CompareTo(object)](https://learn.microsoft.com/dotnet/api/system.icomparable.compareto)).

**Implements**

[CompareTo(object)](https://learn.microsoft.com/dotnet/api/system.icomparable.compareto)

#### CompareTo(OpcRange)

Compares the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) with another [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public int CompareTo(OpcRange other)
```

</div>

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

```vbnet
Public Function CompareTo(other As OpcRange) As Integer
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `other` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare with this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |

**Returns**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

A 32-bit signed integer that indicates the relative order of the objects being compared ([CompareTo(T)](https://learn.microsoft.com/dotnet/api/system.icomparable-1.compareto)).

**Implements**

[CompareTo(OpcRange)](https://learn.microsoft.com/dotnet/api/system.icomparable-1.compareto)

### Equals

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

| Overload | Description |
|---|---|
| [Equals(object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#equals-system-object)<span class="api-meta">override</span> | Determines whether the specified `other` is equal to this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |
| [Equals(OpcRange)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#equals-opc-uafx-opcrange) | Determines whether the specified `other` is equal to this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |

#### Equals(object)

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

Determines whether the specified `other` is equal to this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public override bool Equals(object other)
```

</div>

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

```vbnet
Public Overrides Function Equals(other As Object) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `other` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare to the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) is equal to the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/); otherwise the value false.

**Overrides**

[Equals(object)](https://learn.microsoft.com/dotnet/api/system.valuetype.equals)

#### Equals(OpcRange)

Determines whether the specified `other` is equal to this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public bool Equals(OpcRange other)
```

</div>

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

```vbnet
Public Function Equals(other As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `other` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare to the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) is equal to the current [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/); otherwise the value false.

**Implements**

[Equals(OpcRange)](https://learn.microsoft.com/dotnet/api/system.iequatable-1.equals)

### GetHashCode

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

Retrieves a hash code for this [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public override int GetHashCode()
```

</div>

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

```vbnet
Public Overrides Function GetHashCode() As Integer
```

</div>

**Returns**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

An [int](https://learn.microsoft.com/dotnet/api/system.int32) that contains the hash code for the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

**Overrides**

[GetHashCode()](https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode)

### Of

Determines the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) which applies to the `dimension` specified.

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

```csharp
public OpcRange Of(int dimension)
```

</div>

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

```vbnet
Public Function [Of](dimension As Integer) As OpcRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dimension` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the dimension its range is to be determined. |

**Returns**

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

The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) which applies to the `dimension` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `dimension` is less than zero or greater or equals to [Dimensions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#dimensions). |

### Parse

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

Converts the specified [string](https://learn.microsoft.com/dotnet/api/system.string) to its [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) equivalent.

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

```csharp
public static OpcRange Parse(string value)
```

</div>

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

```vbnet
Public Shared Function Parse(value As String) As OpcRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [String](https://learn.microsoft.com/dotnet/api/system.string) | A [string](https://learn.microsoft.com/dotnet/api/system.string) containing the textual representation of a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to convert to. |

**Returns**

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

A [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) which represents the numerical range data of the `value` specified.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `value` is a null reference (Nothing in Visual Basic). |
| [FormatException](https://learn.microsoft.com/dotnet/api/system.formatexception) | The `value` is not a valid textual representation of a numerical range. |

### ToString

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

Converts the value of this instance to its equivalent string representation.

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

The string representation.

**Overrides**

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

### TryParse

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

Tries to convert the specified [string](https://learn.microsoft.com/dotnet/api/system.string) to its [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) equivalent. A return value indicates whether the conversion succeeded or failed.

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

```csharp
public static bool TryParse(string value, out OpcRange result)
```

</div>

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

```vbnet
Public Shared Function TryParse(value As String, result As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [String](https://learn.microsoft.com/dotnet/api/system.string) | A [string](https://learn.microsoft.com/dotnet/api/system.string) containing the textual representation of a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to convert to. |
| `result` | out [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | When this method returns, if the conversion succeeded, the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) if `value` is a valid textual represention of a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). If the conversion failed, contains a default [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). The conversion fails if `value` is a null reference (Nothing in Visual Basic) or is not a valid textual representation of a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if `value` was converted successfully; otherwise the value false.

## Operators

### Equality

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

Returns a value indicating whether two values of [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) are equal.

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

```csharp
public static bool operator ==(OpcRange left, OpcRange right)
```

</div>

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

```vbnet
Public Shared Operator =(left As OpcRange, right As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The first [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare. |
| `right` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The second [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if left and right are equal; otherwise the value false.

### Explicit

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

| Overload | Description |
|---|---|
| [explicit operator string(OpcRange)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-explicit-opc-uafx-opcrange-system-string)<span class="api-meta">static</span> | Converts a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to a [string](https://learn.microsoft.com/dotnet/api/system.string) object. |
| [explicit operator NumericRange(OpcRange)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-explicit-opc-uafx-opcrange-opc-ua-numericrange)<span class="api-meta">static</span> | Converts a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to an <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr> object. |

#### explicit operator string(OpcRange)

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

Converts a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to a [string](https://learn.microsoft.com/dotnet/api/system.string) object.

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

```csharp
public static explicit operator string(OpcRange value)
```

</div>

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

```vbnet
Public Shared Narrowing Operator CType(value As OpcRange) As String
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | A [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) that represents the numeric range. |

**Returns**

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

The [string](https://learn.microsoft.com/dotnet/api/system.string) used to represent the `value`.

#### explicit operator NumericRange(OpcRange)

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

Converts a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to an <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr> object.

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

```csharp
public static explicit operator NumericRange(OpcRange value)
```

</div>

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

```vbnet
Public Shared Narrowing Operator CType(value As OpcRange) As NumericRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | A [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) that represents the numeric range. |

**Returns**

<abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr>

An instance of the <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr> initialized from the `value`.

### GreaterThan

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

Determines whether the first specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value is greater than the second specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value.

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

```csharp
public static bool operator >(OpcRange left, OpcRange right)
```

</div>

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

```vbnet
Public Shared Operator >(left As OpcRange, right As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The first [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |
| `right` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The second [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if `left` is greater than `right`; otherwise, false.

### GreaterThanOrEqual

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

Determines whether the first specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value is greater than or equal to the second specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value.

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

```csharp
public static bool operator >=(OpcRange left, OpcRange right)
```

</div>

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

```vbnet
Public Shared Operator >=(left As OpcRange, right As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The first [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |
| `right` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The second [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if `left` is greater than or equal to `right`; otherwise, false.

### Implicit

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

| Overload | Description |
|---|---|
| [implicit operator OpcRange(int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-implicit-system-int32-opc-uafx-opcrange)<span class="api-meta">static</span> | Converts an [int](https://learn.microsoft.com/dotnet/api/system.int32) to a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value using the `value` as the [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |
| [implicit operator OpcRange((int, int))](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-implicit-system-valuetuple-of-system-int32-system-int32-opc-uafx-opcrange)<span class="api-meta">static</span> | Converts a [Tuple&lt;T1, T2&gt;](https://learn.microsoft.com/dotnet/api/system.tuple-2) of [int](https://learn.microsoft.com/dotnet/api/system.int32) values to a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value using the [Item1](https://learn.microsoft.com/dotnet/api/system.tuple-2.item1) as the [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) and the [Item2](https://learn.microsoft.com/dotnet/api/system.tuple-2.item2) as the [End](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#end) of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/). |
| [implicit operator OpcRange(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-implicit-system-string-opc-uafx-opcrange)<span class="api-meta">static</span> | Converts a [string](https://learn.microsoft.com/dotnet/api/system.string) to an [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) object. |
| [implicit operator OpcRange(NumericRange)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-implicit-opc-ua-numericrange-opc-uafx-opcrange)<span class="api-meta">static</span> | Converts a <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr> to an [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) object. |

#### implicit operator OpcRange(int)

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

Converts an [int](https://learn.microsoft.com/dotnet/api/system.int32) to a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value using the `value` as the [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public static implicit operator OpcRange(int value)
```

</div>

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

```vbnet
Public Shared Widening Operator CType(value As Integer) As OpcRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The [int](https://learn.microsoft.com/dotnet/api/system.int32) value. |

**Returns**

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

The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value from the `value`.

#### implicit operator OpcRange((int, int))

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

Converts a [Tuple&lt;T1, T2&gt;](https://learn.microsoft.com/dotnet/api/system.tuple-2) of [int](https://learn.microsoft.com/dotnet/api/system.int32) values to a [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value using the [Item1](https://learn.microsoft.com/dotnet/api/system.tuple-2.item1) as the [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) and the [Item2](https://learn.microsoft.com/dotnet/api/system.tuple-2.item2) as the [End](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#end) of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/).

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

```csharp
public static implicit operator OpcRange((int, int) value)
```

</div>

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

```vbnet
Public Shared Widening Operator CType(value As (Integer, Integer)) As OpcRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [ValueTuple](https://learn.microsoft.com/dotnet/api/system.valuetuple-2)&lt;[Int32](https://learn.microsoft.com/dotnet/api/system.int32), [Int32](https://learn.microsoft.com/dotnet/api/system.int32)&gt; | The [Tuple&lt;T1, T2&gt;](https://learn.microsoft.com/dotnet/api/system.tuple-2) of [int](https://learn.microsoft.com/dotnet/api/system.int32) values. |

**Returns**

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

The [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value from the `value`.

#### implicit operator OpcRange(string)

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

Converts a [string](https://learn.microsoft.com/dotnet/api/system.string) to an [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) object.

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

```csharp
public static implicit operator OpcRange(string value)
```

</div>

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

```vbnet
Public Shared Widening Operator CType(value As String) As OpcRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [String](https://learn.microsoft.com/dotnet/api/system.string) | A string that represents the numeric range. |

**Returns**

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

An instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) initialized from the `value`.

#### implicit operator OpcRange(NumericRange)

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

Converts a <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr> to an [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) object.

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

```csharp
public static implicit operator OpcRange(NumericRange value)
```

</div>

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

```vbnet
Public Shared Widening Operator CType(value As NumericRange) As OpcRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr> | A <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.NumericRange">NumericRange</abbr> that represents the numeric range. |

**Returns**

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

An instance of the [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) initialized from the `value`.

### Inequality

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

Returns a value indicating whether two values of [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) are not equal.

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

```csharp
public static bool operator !=(OpcRange left, OpcRange right)
```

</div>

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

```vbnet
Public Shared Operator <>(left As OpcRange, right As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The first [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare. |
| `right` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The second [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) to compare. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if left and right are not equal; otherwise the value false.

### LessThan

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

Determines whether the first specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value is less than the second specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value.

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

```csharp
public static bool operator <(OpcRange left, OpcRange right)
```

</div>

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

```vbnet
Public Shared Operator <(left As OpcRange, right As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The first [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |
| `right` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The second [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if `left` is less than `right`; otherwise the value false.

### LessThanOrEqual

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

Determines whether the first specified [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value is less than or equal to the second [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value.

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

```csharp
public static bool operator <=(OpcRange left, OpcRange right)
```

</div>

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

```vbnet
Public Shared Operator <=(left As OpcRange, right As OpcRange) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The first [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |
| `right` | [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) | The second [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/) value. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if `left` is less than or equal to `right`; otherwise the value false.
