internal OpcDaItemAttributes(OPCITEMATTRIBUTES itemAttributes) { AccessPath = itemAttributes.szAccessPath; ItemID = itemAttributes.szItemID; IsActive = itemAttributes.bActive; ClientHandle = itemAttributes.hClient; ServerHandle = itemAttributes.hServer; AccessRights = (OpcDaAccessRights) itemAttributes.dwAccessRights; Blob = new byte[itemAttributes.dwBlobSize]; Marshal.Copy(itemAttributes.pBlob, Blob, 0, Blob.Length); RequestedDataType = TypeConverter.FromVarEnum((VarEnum) itemAttributes.vtRequestedDataType); CanonicalDataType = TypeConverter.FromVarEnum((VarEnum) itemAttributes.vtCanonicalDataType); EUType = (OpcDaEUType) itemAttributes.dwEUType; EUInfo = itemAttributes.vEUInfo; }
internal OpcDaItem(OPCITEMATTRIBUTES opcItemDefinition, OpcDaGroup @group) { Group = @group; ClientHandle = opcItemDefinition.hClient; ServerHandle = opcItemDefinition.hServer; ItemId = opcItemDefinition.szItemID; RequestedDataType = TypeConverter.FromVarEnum((VarEnum) opcItemDefinition.vtRequestedDataType); CanonicalDataType = TypeConverter.FromVarEnum((VarEnum) opcItemDefinition.vtCanonicalDataType); AccessPath = opcItemDefinition.szAccessPath; IsActive = opcItemDefinition.bActive; AccessRights = (OpcDaAccessRights) opcItemDefinition.dwAccessRights; if (opcItemDefinition.pBlob != IntPtr.Zero) { Blob = new byte[opcItemDefinition.dwBlobSize]; Marshal.Copy(opcItemDefinition.pBlob, Blob, 0, Blob.Length); } }