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
| Overload | Description |
|---|---|
| OpcRange( | Initializes a new instance of the OpcRange with the specified start index of a single element. |
| 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( | Initializes a new instance of the OpcRange with the specified start and end index of a range of elements. |
| 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.
public OpcRange(int start)Public Sub New(start As Integer)Parameters
| Name | Type | Description |
|---|---|---|
start | Int32 | The index of a single element to identify. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The 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.
public OpcRange(int start, OpcRange next)Public Sub New(start As Integer, [next] As OpcRange)Parameters
| Name | Type | Description |
|---|---|---|
start | Int32 | The index of a single element in the first dimension. |
next | OpcRange | The OpcRange for the next dimension. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The 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.
public OpcRange(int start, int end)Public Sub New(start As Integer, [end] As Integer)Parameters
| Name | Type | Description |
|---|---|---|
start | Int32 | The index of the first element in the range. |
end | Int32 | The index of the last element in the range. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The start is not less than end. |
| Argument | The 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.
public OpcRange(int start, int end, OpcRange next)Public Sub New(start As Integer, [end] As Integer, [next] As OpcRange)Parameters
| Name | Type | Description |
|---|---|---|
start | Int32 | The index of the first element in the first dimension. |
end | Int32 | The index of the last element in the first dimension. |
next | OpcRange | The OpcRange for the next dimension. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The start is not less than end. |
| Argument | The start or end is less than zero. |
Fields
Empty
Stores the value used to identify an undefined OpcRange.
public static readonly OpcRange EmptyPublic Shared ReadOnly Empty As OpcRangeField value
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).
public int Dimensions { get; }Public ReadOnly Property Dimensions As IntegerProperty value
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.
public int End { get; }Public ReadOnly Property [End] As IntegerProperty value
The zero-based index of the last element in the range.
Length
Gets the total number of elements identified by this OpcRange.
public int Length { get; }Public ReadOnly Property Length As IntegerProperty value
The total number of elements identified from Start to End by this OpcRange.
Next
Gets the OpcRange for the next dimension within this OpcRange.
public OpcRange Next { get; }Public ReadOnly Property [Next] As OpcRangeProperty value
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.
public int Start { get; }Public ReadOnly Property Start As IntegerProperty value
The zero-based index of the first element in the range.
Methods
CompareTo
| Overload | Description |
|---|---|
| CompareTo( | Compares the current OpcRange with the other. |
| CompareTo( | Compares the current OpcRange with another OpcRange. |
CompareTo(object)
Compares the current OpcRange with the other.
public int CompareTo(object other)Public Function CompareTo(other As Object) As IntegerParameters
| Name | Type | Description |
|---|---|---|
other | Object | The OpcRange to compare with this OpcRange. |
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(object)).
Implements
CompareTo(OpcRange)
Compares the current OpcRange with another OpcRange.
public int CompareTo(OpcRange other)Public Function CompareTo(other As OpcRange) As IntegerParameters
| Name | Type | Description |
|---|---|---|
other | OpcRange | The OpcRange to compare with this OpcRange. |
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(T)).
Implements
Equals
| Overload | Description |
|---|---|
| Equals( | Determines whether the specified other is equal to this OpcRange. |
| Equals( | Determines whether the specified other is equal to this OpcRange. |
Equals(object)
Determines whether the specified other is equal to this OpcRange.
public override bool Equals(object other)Public Overrides Function Equals(other As Object) As BooleanParameters
| Name | Type | Description |
|---|---|---|
other | Object | The OpcRange to compare to the current OpcRange. |
Returns
The value true if the specified OpcRange is equal to the current OpcRange; otherwise the value false.
Overrides
Equals(OpcRange)
Determines whether the specified other is equal to this OpcRange.
public bool Equals(OpcRange other)Public Function Equals(other As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
other | OpcRange | The OpcRange to compare to the current OpcRange. |
Returns
The value true if the specified OpcRange is equal to the current OpcRange; otherwise the value false.
Implements
GetHashCode
Retrieves a hash code for this OpcRange.
public override int GetHashCode()Public Overrides Function GetHashCode() As IntegerReturns
An int that contains the hash code for the OpcRange.
Overrides
Of
Determines the OpcRange which applies to the dimension specified.
public OpcRange Of(int dimension)Public Function [Of](dimension As Integer) As OpcRangeParameters
| Name | Type | Description |
|---|---|---|
dimension | Int32 | The zero-based index of the dimension its range is to be determined. |
Returns
The OpcRange which applies to the dimension specified.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The dimension is less than zero or greater or equals to Dimensions. |
Parse
Converts the specified string to its OpcRange equivalent.
public static OpcRange Parse(string value)Public Shared Function Parse(value As String) As OpcRangeParameters
| Name | Type | Description |
|---|---|---|
value | String | A string containing the textual representation of a OpcRange to convert to. |
Returns
A OpcRange which represents the numerical range data of the value specified.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The value is a null reference ( |
| FormatException | The value is not a valid textual representation of a numerical range. |
ToString
Converts the value of this instance to its equivalent string representation.
public override string ToString()Public Overrides Function ToString() As StringReturns
The string representation.
Overrides
TryParse
Tries to convert the specified string to its OpcRange equivalent. A return value indicates whether the conversion succeeded or failed.
public static bool TryParse(string value, out OpcRange result)Public Shared Function TryParse(value As String, result As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
value | String | A string containing the textual representation of a OpcRange to convert to. |
result | out OpcRange | When 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 ( |
Returns
The value true if value was converted successfully; otherwise the value false.
Operators
Equality
Returns a value indicating whether two values of OpcRange are equal.
public static bool operator ==(OpcRange left, OpcRange right)Public Shared Operator =(left As OpcRange, right As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | OpcRange | The first OpcRange to compare. |
right | OpcRange | The second OpcRange to compare. |
Returns
The value true if left and right are equal; otherwise the value false.
Explicit
| Overload | Description |
|---|---|
| explicit operator string( | Converts a OpcRange to a string object. |
| explicit operator NumericRange( | Converts a OpcRange to an NumericRange object. |
explicit operator string(OpcRange)
Converts a OpcRange to a string object.
public static explicit operator string(OpcRange value)Public Shared Narrowing Operator CType(value As OpcRange) As StringParameters
| Name | Type | Description |
|---|---|---|
value | OpcRange | A OpcRange that represents the numeric range. |
Returns
The string used to represent the value.
explicit operator NumericRange(OpcRange)
Converts a OpcRange to an NumericRange object.
public static explicit operator NumericRange(OpcRange value)Public Shared Narrowing Operator CType(value As OpcRange) As NumericRangeParameters
| Name | Type | Description |
|---|---|---|
value | OpcRange | A OpcRange that represents the numeric range. |
Returns
NumericRange
An instance of the NumericRange initialized from the value.
GreaterThan
Determines whether the first specified OpcRange value is greater than the second specified OpcRange value.
public static bool operator >(OpcRange left, OpcRange right)Public Shared Operator >(left As OpcRange, right As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | OpcRange | The first OpcRange value. |
right | OpcRange | The second OpcRange value. |
Returns
The value true if left is greater than right; otherwise, false.
GreaterThanOrEqual
Determines whether the first specified OpcRange value is greater than or equal to the second specified OpcRange value.
public static bool operator >=(OpcRange left, OpcRange right)Public Shared Operator >=(left As OpcRange, right As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | OpcRange | The first OpcRange value. |
right | OpcRange | The second OpcRange value. |
Returns
The value true if left is greater than or equal to right; otherwise, false.
Implicit
| Overload | Description |
|---|---|
| implicit operator OpcRange( | Converts an int to a OpcRange value using the value as the Start of the OpcRange. |
| implicit operator OpcRange( | Converts a Tuple< |
| implicit operator OpcRange( | Converts a string to an OpcRange object. |
| implicit operator OpcRange( | Converts a NumericRange to an OpcRange object. |
implicit operator OpcRange(int)
Converts an int to a OpcRange value using the value as the Start of the OpcRange.
public static implicit operator OpcRange(int value)Public Shared Widening Operator CType(value As Integer) As OpcRangeParameters
| Name | Type | Description |
|---|---|---|
value | Int32 | The int value. |
Returns
The OpcRange value from the value.
implicit operator OpcRange((int, int))
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.
public static implicit operator OpcRange((int, int) value)Public Shared Widening Operator CType(value As (Integer, Integer)) As OpcRangeParameters
| Name | Type | Description |
|---|---|---|
value | ValueTuple<Int32, Int32> | The Tuple< |
Returns
The OpcRange value from the value.
implicit operator OpcRange(string)
Converts a string to an OpcRange object.
public static implicit operator OpcRange(string value)Public Shared Widening Operator CType(value As String) As OpcRangeParameters
| Name | Type | Description |
|---|---|---|
value | String | A string that represents the numeric range. |
Returns
An instance of the OpcRange initialized from the value.
implicit operator OpcRange(NumericRange)
Converts a NumericRange to an OpcRange object.
public static implicit operator OpcRange(NumericRange value)Public Shared Widening Operator CType(value As NumericRange) As OpcRangeParameters
| Name | Type | Description |
|---|---|---|
value | NumericRange | A NumericRange that represents the numeric range. |
Returns
An instance of the OpcRange initialized from the value.
Inequality
Returns a value indicating whether two values of OpcRange are not equal.
public static bool operator !=(OpcRange left, OpcRange right)Public Shared Operator <>(left As OpcRange, right As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | OpcRange | The first OpcRange to compare. |
right | OpcRange | The second OpcRange to compare. |
Returns
The value true if left and right are not equal; otherwise the value false.
LessThan
Determines whether the first specified OpcRange value is less than the second specified OpcRange value.
public static bool operator <(OpcRange left, OpcRange right)Public Shared Operator <(left As OpcRange, right As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | OpcRange | The first OpcRange value. |
right | OpcRange | The second OpcRange value. |
Returns
The value true if left is less than right; otherwise the value false.
LessThanOrEqual
Determines whether the first specified OpcRange value is less than or equal to the second OpcRange value.
public static bool operator <=(OpcRange left, OpcRange right)Public Shared Operator <=(left As OpcRange, right As OpcRange) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | OpcRange | The first OpcRange value. |
right | OpcRange | The second OpcRange value. |
Returns
The value true if left is less than or equal to right; otherwise the value false.

