OpcDataTypeMemberSwitchAttribute Class

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll

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. Use this attribute to explicitly declare a field or property as optional. Its existence within the stream of its custom data type is declared either using a bit within the encoding mask of the whole data type (see OpcDataTypeEncodingMaskAttribute) using the constructors OpcDataTypeMemberSwitchAttribute and OpcDataTypeMemberSwitchAttribute(Int32) or using the value of a preceding member using the constructors OpcDataTypeMemberSwitchAttribute(String), OpcDataTypeMemberSwitchAttribute(String, Int64) or OpcDataTypeMemberSwitchAttribute(String, Int64, OpcMemberSwitchOperator).

C#

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public class OpcDataTypeMemberSwitchAttribute : Attribute, _Attribute


Inheritance ObjectAttribute › OpcDataTypeMemberSwitchAttribute


Attributes AttributeUsageAttribute


Implements InteropServices._Attribute

Name Description
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.
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.
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, 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.
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.
Name Description
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.
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.
Operator Gets a value which identifies the comparison method to use to evaluate the value of member referenced by Name.
Value Gets the value the value of the member referenced by Name is compared to.
Name Description
GetSwitch(Int32) Retrieves the OpcMemberSwitch defined by the OpcDataTypeMemberSwitchAttribute using the bit specified.