Skip to content

Reference

OpcDataTypeMemberSwitchAttribute Members

Declares a field or property of a custom data type, to that the member belongs on that this attribute is applied, with conditional existence of the member within the stream of its custom data type.

Reference

OpcDataTypeMemberSwitchAttribute Members ​

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

Inherits members from Attribute.

Constructors ​

OpcDataTypeMemberSwitchAttribute ​

5 overloads

OverloadDescription
OpcDataTypeMemberSwitchAttribute()Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is indicated by a single bit (the next free bit in sequence of all bits in the encoding mask used bits).
OpcDataTypeMemberSwitchAttribute(int)Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is indicated by the bit specified.
OpcDataTypeMemberSwitchAttribute(string)Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value needs to be "not equals" to zero.
OpcDataTypeMemberSwitchAttribute(string, long)Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value needs to be "equals" to the value specified.
OpcDataTypeMemberSwitchAttribute(string, long, OpcMemberSwitchOperator)Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value is compared to the value using the comparison operator specified.

OpcDataTypeMemberSwitchAttribute() ​

Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is indicated by a single bit (the next free bit in sequence of all bits in the encoding mask used bits). In case there the bit is set the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed.

csharp
public OpcDataTypeMemberSwitchAttribute()
vbnet
Public Sub New()

OpcDataTypeMemberSwitchAttribute(int) ​

Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is indicated by the bit specified.

csharp
public OpcDataTypeMemberSwitchAttribute(int bit)
vbnet
Public Sub New(bit As Integer)

Parameters

NameTypeDescription
bitInt32The zero based number of the bit which indicates whether the field or property the attribute belongs to exists in the stream of the data type. The bit number specified may not be contiguous and may control multiple fields. In case there the bit is set the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe bit is less than zero or greater than 64.

OpcDataTypeMemberSwitchAttribute(string) ​

Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value needs to be "not equals" to zero.

csharp
public OpcDataTypeMemberSwitchAttribute(string name)
vbnet
Public Sub New(name As String)

Parameters

NameTypeDescription
nameStringThe Name or Name (if defined) of the preceding member its value needs to be "not equals" to zero to indicate that the member the attribute belongs to exists and the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed.

Exceptions

ExceptionCondition
ArgumentExceptionThe name is an empty string.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).

OpcDataTypeMemberSwitchAttribute(string, long) ​

Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value needs to be "equals" to the value specified.

csharp
public OpcDataTypeMemberSwitchAttribute(string name, long value)
vbnet
Public Sub New(name As String, value As Long)

Parameters

NameTypeDescription
nameStringThe Name or Name (if defined) of the preceding member its value needs to be "equals" to the value specified to indicate that the member the attribute belongs to exists and the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed.
valueInt64The long-value the value of the member referenced by name needs to be equals to, to indicate that the member the attribute belongs to exists.

Exceptions

ExceptionCondition
ArgumentExceptionThe name is an empty string.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe value is less than MinValue or greater than MaxValue.

OpcDataTypeMemberSwitchAttribute(string, long, OpcMemberSwitchOperator) ​

Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value is compared to the value using the comparison operator specified.

csharp
public OpcDataTypeMemberSwitchAttribute(
    string name,
    long value,
    OpcMemberSwitchOperator @operator)
vbnet
Public Sub New(
    name As String,
    value As Long,
    [operator] As OpcMemberSwitchOperator)

Parameters

NameTypeDescription
nameStringThe Name or Name (if defined) of the preceding member its value is compared to the value specified using the comparison operator specified to indicate that the member the attribute belongs to exists and the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed.
valueInt64The long-value the value of the member referenced by name needs fulfill using the comparison operator specified, to indicate that the member the attribute belongs to exists.
operatorOpcMemberSwitchOperatorOne of the members defined by the OpcMemberSwitchOperator enumeration which defines the comparison operator to evaluate against the value of the member referenced by name. Only in case there the comparison result is equals true, the member this attribute belongs to exists; otherwise the result is equals false it is skipped when reading or writing the data of its data type.

Exceptions

ExceptionCondition
ArgumentExceptionThe name is an empty string.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe value is less than MinValue or greater than MaxValue.

Properties ​

Bit ​

Gets the number of the bit which indiciates whether the field or property the attribute belongs to exists in the stream of the data type.

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

Property value

Int32

The zero based number of the bit, which may not be contiguous and may control multiple fields. The default value is -1. In case there the value of the Bit property is equals -1 and the value of the Value property is a null reference (Nothing in Visual Basic) this OpcDataTypeMemberSwitchAttribute refers to a OpcMemberSwitch which is determined by the next free bit in sequence of all bits in the encoding mask used bits.

Name ​

Gets the name of the preceding member its value is to be evaluated to indicate that the member the attribute belongs exists in the stream of the data type.

csharp
public string Name { get; }
vbnet
Public ReadOnly Property Name As String

Property value

String

The Name or Name (if defined) of the preceding member or a null reference (Nothing in Visual Basic) in case there this OpcDataTypeMemberSwitchAttribute refers to a OpcMemberSwitch which is determined by the value of the Bit property.

Operator ​

Gets a value which identifies the comparison method to use to evaluate the value of member referenced by Name.

csharp
public OpcMemberSwitchOperator? Operator { get; }
vbnet
Public ReadOnly Property [Operator] As OpcMemberSwitchOperator?

Property value

Nullable<OpcMemberSwitchOperator>

One of the members defined by the OpcMemberSwitchOperator enumeration which defines the comparison operator to evaluate or a null reference (Nothing in Visual Basic) if a default operator is to be used. The default operator used is determined by the value of the Value property. If Value is a null reference (Nothing in Visual Basic) NotEqual is used; otherwise Equals.

Value ​

Gets the value the value of the member referenced by Name is compared to.

csharp
public long? Value { get; }
vbnet
Public ReadOnly Property Value As Long?

Property value

Nullable<Int64>

The long-value the value of the member referenced by Name is compared to or a null reference (Nothing in Visual Basic) if either the Bit property is set or a comparison against zero needs to be evaluated by default using the NotEqual operator.

Methods ​

GetSwitch ​

Retrieves the OpcMemberSwitch defined by the OpcDataTypeMemberSwitchAttribute using the bit specified.

csharp
public OpcMemberSwitch GetSwitch(int bit)
vbnet
Public Function GetSwitch(bit As Integer) As OpcMemberSwitch

Parameters

NameTypeDescription
bitInt32The zero based number of the next free bit in sequence of all bits in the encoding mask used bits if Name is a null reference (Nothing in Visual Basic) and Bit is equals to -1.

Returns

OpcMemberSwitch

A new OpcMemberSwitch instance which provides the information required to switch the member the attribute belongs to.