Skip to content

Reference

OpcRange Members

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.

Reference

OpcRange Members ​

Type
OpcRange
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Constructors ​

OpcRange ​

4 overloads

OverloadDescription
OpcRange(int)Initializes a new instance of the OpcRange with the specified start index of a single element.
OpcRange(int, OpcRange)Initializes a new instance of the OpcRange with the specified start index of a single element in the first dimension used for the next range.
OpcRange(int, int)Initializes a new instance of the OpcRange with the specified start and end index of a range of elements.
OpcRange(int, int, OpcRange)Initializes a new instance of the 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 with the specified start index of a single element.

csharp
public OpcRange(int start)
vbnet
Public Sub New(start As Integer)

Parameters

NameTypeDescription
startInt32The index of a single element to identify.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe start is less than zero.

OpcRange(int, OpcRange) ​

Initializes a new instance of the OpcRange with the specified start index of a single element in the first dimension used for the next range.

csharp
public OpcRange(int start, OpcRange next)
vbnet
Public Sub New(start As Integer, [next] As OpcRange)

Parameters

NameTypeDescription
startInt32The index of a single element in the first dimension.
nextOpcRangeThe OpcRange for the next dimension.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe start is less than zero.

OpcRange(int, int) ​

Initializes a new instance of the OpcRange with the specified start and end index of a range of elements.

csharp
public OpcRange(int start, int end)
vbnet
Public Sub New(start As Integer, [end] As Integer)

Parameters

NameTypeDescription
startInt32The index of the first element in the range.
endInt32The index of the last element in the range.

Exceptions

ExceptionCondition
ArgumentExceptionThe start is not less than end.
ArgumentOutOfRangeExceptionThe start or end is less than zero.

OpcRange(int, int, OpcRange) ​

Initializes a new instance of the OpcRange with the specified start and end index of a range of elements in the first dimension used for the next range.

csharp
public OpcRange(int start, int end, OpcRange next)
vbnet
Public Sub New(start As Integer, [end] As Integer, [next] As OpcRange)

Parameters

NameTypeDescription
startInt32The index of the first element in the first dimension.
endInt32The index of the last element in the first dimension.
nextOpcRangeThe OpcRange for the next dimension.

Exceptions

ExceptionCondition
ArgumentExceptionThe start is not less than end.
ArgumentOutOfRangeExceptionThe start or end is less than zero.

Fields ​

Empty ​

static

Stores the value used to identify an undefined OpcRange.

csharp
public static readonly OpcRange Empty
vbnet
Public Shared ReadOnly Empty As OpcRange

Field value

OpcRange

Remarks

Do not use Empty, because the foundations definition of empty does not support the 'default' value of a struct accordingly. This means the Empty uses the value -1 for the Start and End properties. However this can only be assured in case the user uses Empty (or Empty with this value). To assure that the 'real' default value results into a 'not used/considered' OpcRange we've decided to use our own definition of Empty using the default value zero for Start and End to assure that the default value of a OpcRange matches the definition of Empty.

Properties ​

Dimensions ​

Gets the total number of dimensions identified by this and its subsequent OpcRange values (see Next).

csharp
public int Dimensions { get; }
vbnet
Public ReadOnly Property Dimensions As Integer

Property value

Int32

The total number of dimensions identified by this and its subsequent OpcRange values (see Next).

End ​

Gets the index of the last element in the range.

csharp
public int End { get; }
vbnet
Public ReadOnly Property [End] As Integer

Property value

Int32

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

Length ​

Gets the total number of elements identified by this OpcRange.

csharp
public int Length { get; }
vbnet
Public ReadOnly Property Length As Integer

Property value

Int32

The total number of elements identified from Start to End by this OpcRange.

Next ​

Gets the OpcRange for the next dimension within this OpcRange.

csharp
public OpcRange Next { get; }
vbnet
Public ReadOnly Property [Next] As OpcRange

Property value

OpcRange

A OpcRange identifying a single element or a range of elements in the next dimension or Empty if there is no subsequent range defined.

Start ​

Gets the index of the first element in the range.

csharp
public int Start { get; }
vbnet
Public ReadOnly Property Start As Integer

Property value

Int32

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

Methods ​

CompareTo ​

2 overloads

OverloadDescription
CompareTo(object)Compares the current OpcRange with the other.
CompareTo(OpcRange)Compares the current OpcRange with another OpcRange.

CompareTo(object) ​

Compares the current OpcRange with the other.

csharp
public int CompareTo(object other)
vbnet
Public Function CompareTo(other As Object) As Integer

Parameters

NameTypeDescription
otherObjectThe OpcRange to compare with this OpcRange.

Returns

Int32

A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(object)).

Implements

CompareTo(object)

CompareTo(OpcRange) ​

Compares the current OpcRange with another OpcRange.

csharp
public int CompareTo(OpcRange other)
vbnet
Public Function CompareTo(other As OpcRange) As Integer

Parameters

NameTypeDescription
otherOpcRangeThe OpcRange to compare with this OpcRange.

Returns

Int32

A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(T)).

Implements

CompareTo(OpcRange)

Equals ​

2 overloads

OverloadDescription
Equals(object)overrideDetermines whether the specified other is equal to this OpcRange.
Equals(OpcRange)Determines whether the specified other is equal to this OpcRange.

Equals(object) ​

override

Determines whether the specified other is equal to this OpcRange.

csharp
public override bool Equals(object other)
vbnet
Public Overrides Function Equals(other As Object) As Boolean

Parameters

NameTypeDescription
otherObjectThe OpcRange to compare to the current OpcRange.

Returns

Boolean

The value true if the specified OpcRange is equal to the current OpcRange; otherwise the value false.

Overrides

Equals(object)

Equals(OpcRange) ​

Determines whether the specified other is equal to this OpcRange.

csharp
public bool Equals(OpcRange other)
vbnet
Public Function Equals(other As OpcRange) As Boolean

Parameters

NameTypeDescription
otherOpcRangeThe OpcRange to compare to the current OpcRange.

Returns

Boolean

The value true if the specified OpcRange is equal to the current OpcRange; otherwise the value false.

Implements

Equals(OpcRange)

GetHashCode ​

override

Retrieves a hash code for this OpcRange.

csharp
public override int GetHashCode()
vbnet
Public Overrides Function GetHashCode() As Integer

Returns

Int32

An int that contains the hash code for the OpcRange.

Overrides

GetHashCode()

Of ​

Determines the OpcRange which applies to the dimension specified.

csharp
public OpcRange Of(int dimension)
vbnet
Public Function [Of](dimension As Integer) As OpcRange

Parameters

NameTypeDescription
dimensionInt32The zero-based index of the dimension its range is to be determined.

Returns

OpcRange

The OpcRange which applies to the dimension specified.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe dimension is less than zero or greater or equals to Dimensions.

Parse ​

static

Converts the specified string to its OpcRange equivalent.

csharp
public static OpcRange Parse(string value)
vbnet
Public Shared Function Parse(value As String) As OpcRange

Parameters

NameTypeDescription
valueStringA string containing the textual representation of a OpcRange to convert to.

Returns

OpcRange

A OpcRange which represents the numerical range data of the value specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe value is a null reference (Nothing in Visual Basic).
FormatExceptionThe value is not a valid textual representation of a numerical range.

ToString ​

override

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

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

The string representation.

Overrides

ToString()

TryParse ​

static

Tries to convert the specified string to its OpcRange equivalent. A return value indicates whether the conversion succeeded or failed.

csharp
public static bool TryParse(string value, out OpcRange result)
vbnet
Public Shared Function TryParse(value As String, result As OpcRange) As Boolean

Parameters

NameTypeDescription
valueStringA string containing the textual representation of a OpcRange to convert to.
resultout OpcRangeWhen this method returns, if the conversion succeeded, the OpcRange if value is a valid textual represention of a OpcRange. If the conversion failed, contains a default OpcRange. The conversion fails if value is a null reference (Nothing in Visual Basic) or is not a valid textual representation of a OpcRange.

Returns

Boolean

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

Operators ​

Equality ​

static

Returns a value indicating whether two values of OpcRange are equal.

csharp
public static bool operator ==(OpcRange left, OpcRange right)
vbnet
Public Shared Operator =(left As OpcRange, right As OpcRange) As Boolean

Parameters

NameTypeDescription
leftOpcRangeThe first OpcRange to compare.
rightOpcRangeThe second OpcRange to compare.

Returns

Boolean

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

Explicit ​

static · 2 overloads

OverloadDescription
explicit operator string(OpcRange)staticConverts a OpcRange to a string object.
explicit operator NumericRange(OpcRange)staticConverts a OpcRange to an NumericRange object.

explicit operator string(OpcRange) ​

static

Converts a OpcRange to a string object.

csharp
public static explicit operator string(OpcRange value)
vbnet
Public Shared Narrowing Operator CType(value As OpcRange) As String

Parameters

NameTypeDescription
valueOpcRangeA OpcRange that represents the numeric range.

Returns

String

The string used to represent the value.

explicit operator NumericRange(OpcRange) ​

static

Converts a OpcRange to an NumericRange object.

csharp
public static explicit operator NumericRange(OpcRange value)
vbnet
Public Shared Narrowing Operator CType(value As OpcRange) As NumericRange

Parameters

NameTypeDescription
valueOpcRangeA OpcRange that represents the numeric range.

Returns

NumericRange

An instance of the NumericRange initialized from the value.

GreaterThan ​

static

Determines whether the first specified OpcRange value is greater than the second specified OpcRange value.

csharp
public static bool operator >(OpcRange left, OpcRange right)
vbnet
Public Shared Operator >(left As OpcRange, right As OpcRange) As Boolean

Parameters

NameTypeDescription
leftOpcRangeThe first OpcRange value.
rightOpcRangeThe second OpcRange value.

Returns

Boolean

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

GreaterThanOrEqual ​

static

Determines whether the first specified OpcRange value is greater than or equal to the second specified OpcRange value.

csharp
public static bool operator >=(OpcRange left, OpcRange right)
vbnet
Public Shared Operator >=(left As OpcRange, right As OpcRange) As Boolean

Parameters

NameTypeDescription
leftOpcRangeThe first OpcRange value.
rightOpcRangeThe second OpcRange value.

Returns

Boolean

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

Implicit ​

static · 4 overloads

OverloadDescription
implicit operator OpcRange(int)staticConverts an int to a OpcRange value using the value as the Start of the OpcRange.
implicit operator OpcRange((int, int))staticConverts a Tuple<T1, T2> of int values to a OpcRange value using the Item1 as the Start and the Item2 as the End of the OpcRange.
implicit operator OpcRange(string)staticConverts a string to an OpcRange object.
implicit operator OpcRange(NumericRange)staticConverts a NumericRange to an OpcRange object.

implicit operator OpcRange(int) ​

static

Converts an int to a OpcRange value using the value as the Start of the OpcRange.

csharp
public static implicit operator OpcRange(int value)
vbnet
Public Shared Widening Operator CType(value As Integer) As OpcRange

Parameters

NameTypeDescription
valueInt32The int value.

Returns

OpcRange

The OpcRange value from the value.

implicit operator OpcRange((int, int)) ​

static

Converts a Tuple<T1, T2> of int values to a OpcRange value using the Item1 as the Start and the Item2 as the End of the OpcRange.

csharp
public static implicit operator OpcRange((int, int) value)
vbnet
Public Shared Widening Operator CType(value As (Integer, Integer)) As OpcRange

Parameters

NameTypeDescription
valueValueTuple<Int32, Int32>The Tuple<T1, T2> of int values.

Returns

OpcRange

The OpcRange value from the value.

implicit operator OpcRange(string) ​

static

Converts a string to an OpcRange object.

csharp
public static implicit operator OpcRange(string value)
vbnet
Public Shared Widening Operator CType(value As String) As OpcRange

Parameters

NameTypeDescription
valueStringA string that represents the numeric range.

Returns

OpcRange

An instance of the OpcRange initialized from the value.

implicit operator OpcRange(NumericRange) ​

static

Converts a NumericRange to an OpcRange object.

csharp
public static implicit operator OpcRange(NumericRange value)
vbnet
Public Shared Widening Operator CType(value As NumericRange) As OpcRange

Parameters

NameTypeDescription
valueNumericRangeA NumericRange that represents the numeric range.

Returns

OpcRange

An instance of the OpcRange initialized from the value.

Inequality ​

static

Returns a value indicating whether two values of OpcRange are not equal.

csharp
public static bool operator !=(OpcRange left, OpcRange right)
vbnet
Public Shared Operator <>(left As OpcRange, right As OpcRange) As Boolean

Parameters

NameTypeDescription
leftOpcRangeThe first OpcRange to compare.
rightOpcRangeThe second OpcRange to compare.

Returns

Boolean

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

LessThan ​

static

Determines whether the first specified OpcRange value is less than the second specified OpcRange value.

csharp
public static bool operator <(OpcRange left, OpcRange right)
vbnet
Public Shared Operator <(left As OpcRange, right As OpcRange) As Boolean

Parameters

NameTypeDescription
leftOpcRangeThe first OpcRange value.
rightOpcRangeThe second OpcRange value.

Returns

Boolean

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

LessThanOrEqual ​

static

Determines whether the first specified OpcRange value is less than or equal to the second OpcRange value.

csharp
public static bool operator <=(OpcRange left, OpcRange right)
vbnet
Public Shared Operator <=(left As OpcRange, right As OpcRange) As Boolean

Parameters

NameTypeDescription
leftOpcRangeThe first OpcRange value.
rightOpcRangeThe second OpcRange value.

Returns

Boolean

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