OpcDataTypeMemberSwitchAttribute Members

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcDataTypeMemberSwitchAttribute type exposes the following members.

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.

C#

public OpcDataTypeMemberSwitchAttribute()

OpcDataTypeMemberSwitchAttribute(Int32)

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.

C#

public OpcDataTypeMemberSwitchAttribute(int bit)


Parameters

bit Int32

The 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

ArgumentOutOfRangeException

The 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.

C#

public OpcDataTypeMemberSwitchAttribute(string name)


Parameters

name String

The MemberInfo.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

ArgumentException

The name is an empty string.

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

OpcDataTypeMemberSwitchAttribute(String, Int64)

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.

C#

public OpcDataTypeMemberSwitchAttribute(string name, long value)


Parameters

name String

The MemberInfo.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.

value Int64

The Int64-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

ArgumentException

The name is an empty string.

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The value is less than MinValue or greater than MaxValue.

OpcDataTypeMemberSwitchAttribute(String, Int64, 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.

C#

public OpcDataTypeMemberSwitchAttribute(string name, long value, OpcMemberSwitchOperator operator)


Parameters

name String

The MemberInfo.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.

value Int64

The Int64-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.

operator OpcMemberSwitchOperator

One 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

ArgumentException

The name is an empty string.

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The value is less than MinValue or greater than MaxValue.

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.

C#

public int Bit { get; }


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.

C#

public string Name { get; }


Property Value

String

The MemberInfo.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.

C#

public OpcMemberSwitchOperator? Operator { get; }


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.

C#

public long? Value { get; }


Property Value

Nullable<Int64>

The Int64-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 OpcMemberSwitchOperatorNotEqual.

GetSwitch(Int32)

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

C#

public OpcMemberSwitch GetSwitch(int bit)


Parameters

bit Int32

The 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.