~~NOTRANS~~ ====== 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 [[Opc.UaFx.OpcDataTypeEncodingMaskAttribute|OpcDataTypeEncodingMaskAttribute]]) using the constructors [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]] and [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.int32|Int32]]) or using the value of a preceding member using the constructors [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.string|String]]), [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.string|String]], [[https://docs.microsoft.com/en-us/dotnet/api/system.int64|Int64]]) or [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.string|String]], [[https://docs.microsoft.com/en-us/dotnet/api/system.int64|Int64]], [[Opc.UaFx.OpcMemberSwitchOperator|OpcMemberSwitchOperator]]). **C#** \\ <code csharp> [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)] public class OpcDataTypeMemberSwitchAttribute : Attribute, _Attribute </code> \\ **Inheritance** [[https://docs.microsoft.com/en-us/dotnet/api/system.object|Object]] › [[https://docs.microsoft.com/en-us/dotnet/api/system.attribute|Attribute]] › OpcDataTypeMemberSwitchAttribute \\ **Attributes** [[https://docs.microsoft.com/en-us/dotnet/api/system.attributeusageattribute|AttributeUsageAttribute]] \\ **Implements** [[https://docs.microsoft.com/en-us/dotnet/api/system.runtimemembers#InteropServices._Attribute|InteropServices._Attribute]] ===== Constructors ===== <panel> ^ Name ^ Description ^ | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]] | Initializes a new instance of the [[Opc.UaFx.OpcDataTypeMemberSwitchAttribute|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. | | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute-Int32|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.int32|Int32]]) | Initializes a new instance of the [[Opc.UaFx.OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]] class which declares a field or property to be optional while its existence is indicated by the ''bit'' specified. | | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute-String|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.string|String]]) | Initializes a new instance of the [[Opc.UaFx.OpcDataTypeMemberSwitchAttribute|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. | | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute-String-Int64|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.string|String]], [[https://docs.microsoft.com/en-us/dotnet/api/system.int64|Int64]]) | Initializes a new instance of the [[Opc.UaFx.OpcDataTypeMemberSwitchAttribute|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. | | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#OpcDataTypeMemberSwitchAttribute-String-Int64-OpcMemberSwitchOperator|OpcDataTypeMemberSwitchAttribute]]([[https://docs.microsoft.com/en-us/dotnet/api/system.string|String]], [[https://docs.microsoft.com/en-us/dotnet/api/system.int64|Int64]], [[Opc.UaFx.OpcMemberSwitchOperator|OpcMemberSwitchOperator]]) | Initializes a new instance of the [[Opc.UaFx.OpcDataTypeMemberSwitchAttribute|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. | </panel> ===== Properties ===== <panel> ^ Name ^ Description ^ | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#Bit|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. | | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#Name|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. | | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#Operator|Operator]] | Gets a value which identifies the comparison method to use to evaluate the value of member referenced by [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#Name|Name]]. | | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#Value|Value]] | Gets the value the value of the member referenced by [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#Name|Name]] is compared to. | </panel> ===== Methods ===== <panel> ^ Name ^ Description ^ | [[Opc.UaFx.OpcDataTypeMemberSwitchAttributeMembers#GetSwitch-Int32|GetSwitch]]([[https://docs.microsoft.com/en-us/dotnet/api/system.int32|Int32]]) | Retrieves the [[Opc.UaFx.OpcMemberSwitch|OpcMemberSwitch]] defined by the [[Opc.UaFx.OpcDataTypeMemberSwitchAttribute|OpcDataTypeMemberSwitchAttribute]] using the ''bit'' specified. | </panel>