public override DataTypeCollection GetDataTypesInfo() { const DataTypeFeatures common = DataTypeFeatures.Default | DataTypeFeatures.Nullable | DataTypeFeatures.NonKeyIndexing | DataTypeFeatures.Grouping | DataTypeFeatures.Ordering | DataTypeFeatures.Multiple; const DataTypeFeatures index = DataTypeFeatures.Indexing | DataTypeFeatures.Clustering | DataTypeFeatures.FillFactor | DataTypeFeatures.KeyConstraint; var types = new DataTypeCollection(); types.Decimal = DataTypeInfo.Fractional(SqlType.Decimal, common | index, ValueRange.Decimal, 38, "number"); types.Float = DataTypeInfo.Range(SqlType.Float, common | index, ValueRange.Float, "real"); types.Double = DataTypeInfo.Range(SqlType.Double, common | index, ValueRange.Double, "double precision", "float"); types.DateTime = DataTypeInfo.Range(SqlType.DateTime, common | index, ValueRange.DateTime, "timestamp"); types.DateTimeOffset = DataTypeInfo.Range(SqlType.DateTimeOffset, common | index, ValueRange.DateTimeOffset, "TIMESTAMP WITH TIME ZONE"); types.Interval = DataTypeInfo.Range(SqlType.Interval, common | index, ValueRange.TimeSpan, "interval day to second"); types.Char = DataTypeInfo.Stream(SqlType.Char, common | index | DataTypeFeatures.ZeroLengthValueIsNull, 2000, "nchar"); types.VarChar = DataTypeInfo.Stream(SqlType.VarChar, common | index | DataTypeFeatures.ZeroLengthValueIsNull, 2000, "nvarchar2"); types.VarCharMax = DataTypeInfo.Regular(SqlType.VarCharMax, common, "nclob"); types.VarBinaryMax = DataTypeInfo.Regular(SqlType.VarBinaryMax, common, "blob"); return(types); }
private void OnTypesGenerated(DataTypeCollection types) { if (this.TypesGenerated != null) { this.TypesGenerated(this, new DataTypeEventArgs(types)); } }
private void OnTypeGenerated(IDataType type) { if (this.TypesGenerated != null) { DataTypeCollection types = new DataTypeCollection(); types.Add(type); this.TypesGenerated(this, new DataTypeEventArgs(types)); } }
public static DataTypeCollection <IDataType> CreateBuildInTypes() { DataTypeCollection <IDataType> types = new DataTypeCollection <IDataType>(); DataType item = new PrimitiveType("TOD", AdsDatatypeId.ADST_BIGTYPE, 4, PrimitiveTypeFlags.Time, typeof(TOD)); DataType type2 = new PrimitiveType("DT", AdsDatatypeId.ADST_BIGTYPE, 4, PrimitiveTypeFlags.MaskDateTime, typeof(DT)); DataType type3 = new PrimitiveType("UDINT", AdsDatatypeId.ADST_UINT32, 4, PrimitiveTypeFlags.Unsigned, typeof(uint)); types.Add(new BitMappingType("BIT", 1, typeof(bool))); types.Add(new BitMappingType("BIT2", 2, typeof(byte))); types.Add(new BitMappingType("BIT3", 3, typeof(byte))); types.Add(new BitMappingType("BIT4", 4, typeof(byte))); types.Add(new BitMappingType("BIT5", 5, typeof(byte))); types.Add(new BitMappingType("BIT6", 6, typeof(byte))); types.Add(new BitMappingType("BIT7", 7, typeof(byte))); types.Add(new BitMappingType("BIT8", 8, typeof(byte))); types.Add(new PrimitiveType("VOID", AdsDatatypeId.ADST_VOID, 0, PrimitiveTypeFlags.None, typeof(void))); PointerType type4 = new PointerType("POINTER TO VOID", "VOID"); types.Add(type4); AliasType type5 = new AliasType("PVOID", type4); types.Add(type5); types.Add(new PrimitiveType("SINT", AdsDatatypeId.ADST_INT8, 1, PrimitiveTypeFlags.Numeric, typeof(sbyte))); types.Add(new PrimitiveType("USINT", AdsDatatypeId.ADST_UINT8, 1, PrimitiveTypeFlags.MaskNumericUnsigned, typeof(byte))); types.Add(new PrimitiveType("BYTE", AdsDatatypeId.ADST_UINT8, 1, PrimitiveTypeFlags.Unsigned | PrimitiveTypeFlags.System, typeof(byte))); types.Add(new PrimitiveType("UINT8", AdsDatatypeId.ADST_UINT8, 1, PrimitiveTypeFlags.MaskNumericUnsigned, typeof(byte))); types.Add(new PrimitiveType("INT", AdsDatatypeId.ADST_INT16, 2, PrimitiveTypeFlags.Numeric, typeof(short))); types.Add(new PrimitiveType("INT16", AdsDatatypeId.ADST_INT16, 2, PrimitiveTypeFlags.Numeric, typeof(short))); types.Add(new PrimitiveType("UINT", AdsDatatypeId.ADST_UINT16, 2, PrimitiveTypeFlags.MaskNumericUnsigned, typeof(ushort))); types.Add(new PrimitiveType("WORD", AdsDatatypeId.ADST_UINT16, 2, PrimitiveTypeFlags.Unsigned | PrimitiveTypeFlags.System, typeof(ushort))); types.Add(new PrimitiveType("UINT16", AdsDatatypeId.ADST_UINT16, 2, PrimitiveTypeFlags.MaskNumericUnsigned, typeof(ushort))); types.Add(new PrimitiveType("DINT", AdsDatatypeId.ADST_INT32, 4, PrimitiveTypeFlags.Numeric, typeof(int))); types.Add(new PrimitiveType("INT32", AdsDatatypeId.ADST_INT32, 4, PrimitiveTypeFlags.Numeric, typeof(int))); types.Add(type3); types.Add(new PrimitiveType("UINT32", AdsDatatypeId.ADST_UINT32, 4, PrimitiveTypeFlags.Numeric, typeof(uint))); types.Add(new PrimitiveType("DWORD", AdsDatatypeId.ADST_UINT32, 4, PrimitiveTypeFlags.MaskNumericUnsigned, typeof(uint))); types.Add(new PrimitiveType("REAL", AdsDatatypeId.ADST_REAL32, 4, PrimitiveTypeFlags.Numeric | PrimitiveTypeFlags.Float, typeof(float))); types.Add(new PrimitiveType("FLOAT", AdsDatatypeId.ADST_REAL32, 4, PrimitiveTypeFlags.Numeric | PrimitiveTypeFlags.Float, typeof(float))); types.Add(new PrimitiveType("LREAL", AdsDatatypeId.ADST_REAL64, 8, PrimitiveTypeFlags.Numeric | PrimitiveTypeFlags.Float, typeof(double))); types.Add(new PrimitiveType("DOUBLE", AdsDatatypeId.ADST_REAL64, 8, PrimitiveTypeFlags.Numeric | PrimitiveTypeFlags.Float, typeof(double))); types.Add(new PrimitiveType("BOOL", AdsDatatypeId.ADST_BIT, 1, PrimitiveTypeFlags.System, typeof(bool))); types.Add(new PrimitiveType("TIME", AdsDatatypeId.ADST_BIGTYPE, 4, PrimitiveTypeFlags.Time, typeof(TIME))); types.Add(item); types.Add(new PrimitiveType("DATE", AdsDatatypeId.ADST_BIGTYPE, 4, PrimitiveTypeFlags.Date, typeof(DATE))); types.Add(type2); types.Add(new PrimitiveType("LTIME", AdsDatatypeId.ADST_BIGTYPE, 8, PrimitiveTypeFlags.System, typeof(LTIME))); types.Add(new AliasType("DATE_AND_TIME", type2)); types.Add(new AliasType("TIME_OF_DAY", item)); types.Add(new PrimitiveType("LINT", AdsDatatypeId.ADST_INT64, 8, PrimitiveTypeFlags.Numeric, typeof(long))); types.Add(new PrimitiveType("ULINT", AdsDatatypeId.ADST_UINT64, 8, PrimitiveTypeFlags.MaskNumericUnsigned, typeof(ulong))); types.Add(new PrimitiveType("LWORD", AdsDatatypeId.ADST_UINT64, 8, PrimitiveTypeFlags.Numeric, typeof(ulong))); types.Add(new AliasType("OTCID", type3)); types.Add(new AliasType("UXINT", type5)); return(types); }
public override DataTypeCollection GetDataTypesInfo() { var types = new DataTypeCollection(); var common = DataTypeFeatures.Default | DataTypeFeatures.Nullable | DataTypeFeatures.NonKeyIndexing | DataTypeFeatures.Grouping | DataTypeFeatures.Ordering | DataTypeFeatures.Multiple; var index = DataTypeFeatures.Indexing | DataTypeFeatures.Clustering | DataTypeFeatures.FillFactor | DataTypeFeatures.KeyConstraint; var identity = DataTypeFeatures.Identity; types.Boolean = DataTypeInfo.Range(SqlType.Boolean, common | index, ValueRange.Bool, "bit"); types.UInt8 = DataTypeInfo.Range(SqlType.UInt8, common | index | identity, ValueRange.Byte, "tinyint"); types.Int16 = DataTypeInfo.Range(SqlType.Int16, common | index | identity, ValueRange.Int16, "smallint"); types.Int32 = DataTypeInfo.Range(SqlType.Int32, common | index | identity, ValueRange.Int32, "integer", "int"); types.Int64 = DataTypeInfo.Range(SqlType.Int64, common | index | identity, ValueRange.Int64, "bigint"); types.Decimal = DataTypeInfo.Fractional(SqlType.Decimal, common | index, ValueRange.Decimal, 38, "decimal", "numeric"); types.Float = DataTypeInfo.Range(SqlType.Float, common | index, ValueRange.Float, "real"); types.Double = DataTypeInfo.Range(SqlType.Double, common | index, ValueRange.Double, "float"); types.DateTime = DataTypeInfo.Range(SqlType.DateTime, common | index, new ValueRange <DateTime>(new DateTime(1753, 1, 1), new DateTime(9999, 12, 31)), "datetime", "smalldatetime"); types.Char = DataTypeInfo.Stream(SqlType.Char, common | index, 4000, "nchar", "char"); types.VarChar = DataTypeInfo.Stream(SqlType.VarChar, common | index, 4000, "nvarchar", "varchar"); types.VarCharMax = DataTypeInfo.Regular(SqlType.VarCharMax, common, "nvarchar(max)", "ntext", "varchar(max)", "text", "xml"); types.Binary = DataTypeInfo.Stream(SqlType.Binary, common | index, 4000, "binary"); types.VarBinary = DataTypeInfo.Stream(SqlType.VarBinary, common | index, 4000, "varbinary"); types.VarBinaryMax = DataTypeInfo.Regular(SqlType.VarBinaryMax, common, "varbinary(max)", "image"); types.Guid = DataTypeInfo.Regular(SqlType.Guid, common | index, "uniqueidentifier"); return(types); }
/// <inheritdoc/> public override DataTypeCollection GetDataTypesInfo() { var types = new DataTypeCollection(); DataTypeFeatures common = DataTypeFeatures.Default | DataTypeFeatures.Nullable | DataTypeFeatures.NonKeyIndexing | DataTypeFeatures.Grouping | DataTypeFeatures.Ordering | DataTypeFeatures.Multiple; DataTypeFeatures index = DataTypeFeatures.Indexing | DataTypeFeatures.KeyConstraint; DataTypeFeatures identity = DataTypeFeatures.Identity; types.Boolean = DataTypeInfo.Range(SqlType.Boolean, common | index, ValueRange.Bool, "boolean"); types.Int8 = DataTypeInfo.Range(SqlType.Int8, common | index | identity, ValueRange.Byte, "tinyint"); types.Int16 = DataTypeInfo.Range(SqlType.Int16, common | index | identity, ValueRange.Int16, "smallint"); types.Int32 = DataTypeInfo.Range(SqlType.Int32, common | index | identity, ValueRange.Int32, "int"); types.Int64 = DataTypeInfo.Range(SqlType.Int64, common | index | identity, ValueRange.Int64, "bigint"); types.Decimal = DataTypeInfo.Fractional(SqlType.Decimal, common | index, ValueRange.Decimal, 38, "decimal", "numeric", "year"); types.Float = DataTypeInfo.Range(SqlType.Float, common | index, ValueRange.Float, "float"); types.Double = DataTypeInfo.Range(SqlType.Double, common | index, ValueRange.Double, "double precision"); types.DateTime = DataTypeInfo.Range(SqlType.DateTime, common | index, new ValueRange <DateTime>(new DateTime(1000, 1, 1), new DateTime(9999, 12, 31)), "datetime", "time"); types.Char = DataTypeInfo.Stream(SqlType.Char, common | index, 255, "char"); types.VarChar = DataTypeInfo.Stream(SqlType.VarChar, common | index, 4000, "varchar"); types.VarCharMax = DataTypeInfo.Regular(SqlType.VarCharMax, common, "longtext"); types.Binary = DataTypeInfo.Stream(SqlType.Binary, common | index, 255, "binary"); types.VarBinary = DataTypeInfo.Stream(SqlType.VarBinary, common | index, 4000, "varbinary"); types.VarBinaryMax = DataTypeInfo.Regular(SqlType.VarBinaryMax, common, "longblob"); //types.Guid = DataTypeInfo.Regular(SqlType.Guid, common | index, "uuid()"); return(types); }
private void expandDataTypes() { DataTypeCollection <IDataType> types = this._namespaces.AllTypesInternal.Clone(); int count = types.Count; foreach (DataType type in types) { this.expandDataType(type); } int num2 = this._namespaces.AllTypesInternal.Count; object[] args = new object[] { num2 - count }; Module.Trace.TraceInformation("{0} datatypes expanded!", args); }
public override DataTypeCollection GetDataTypesInfo() { var commonFeatures = DataTypeFeatures.Grouping | DataTypeFeatures.Indexing | DataTypeFeatures.KeyConstraint | DataTypeFeatures.Nullable | DataTypeFeatures.Ordering | DataTypeFeatures.Multiple | DataTypeFeatures.Default; var lobFeatures = DataTypeFeatures.Nullable | DataTypeFeatures.Multiple | DataTypeFeatures.Default; var dtc = new DataTypeCollection(); dtc.Int16 = DataTypeInfo.Range(SqlType.Int16, commonFeatures, ValueRange.Int16, "smallint"); dtc.Int32 = DataTypeInfo.Range(SqlType.Int32, commonFeatures, ValueRange.Int32, "integer"); dtc.Int64 = DataTypeInfo.Range(SqlType.Int64, commonFeatures, ValueRange.Int64, "bigint"); dtc.Decimal = DataTypeInfo.Fractional(SqlType.Decimal, commonFeatures, ValueRange.Decimal, 18, "numeric", "decimal"); dtc.Float = DataTypeInfo.Range(SqlType.Float, commonFeatures, ValueRange.Float, "float"); dtc.Double = DataTypeInfo.Range(SqlType.Double, commonFeatures, ValueRange.Double, "double precision"); dtc.DateTime = DataTypeInfo.Range(SqlType.DateTime, commonFeatures, ValueRange.DateTime, "timestamp"); dtc.Char = DataTypeInfo.Stream(SqlType.Char, commonFeatures, MaxCharLength, "char"); dtc.VarChar = DataTypeInfo.Stream(SqlType.VarChar, commonFeatures, MaxCharLength, "varchar"); dtc.VarCharMax = DataTypeInfo.Stream(SqlType.VarCharMax, lobFeatures, MaxTextLength, "blob sub_type 1"); dtc.VarBinaryMax = DataTypeInfo.Stream(SqlType.VarBinaryMax, lobFeatures, MaxTextLength, "blob sub_type 0"); return(dtc); }
public override DataTypeCollection GetDataTypesInfo() { var commonFeatures = DataTypeFeatures.Clustering | DataTypeFeatures.Grouping | DataTypeFeatures.Indexing | DataTypeFeatures.KeyConstraint | DataTypeFeatures.Nullable | DataTypeFeatures.Ordering | DataTypeFeatures.Multiple | DataTypeFeatures.Default; DataTypeCollection dtc = base.GetDataTypesInfo(); dtc.Guid = DataTypeInfo.Regular(SqlType.Guid, commonFeatures, "uuid"); return(dtc); }
public override DataTypeCollection GetDataTypesInfo() { var types = new DataTypeCollection(); var common = DataTypeFeatures.Default | DataTypeFeatures.Nullable | DataTypeFeatures.NonKeyIndexing | DataTypeFeatures.Grouping | DataTypeFeatures.Ordering | DataTypeFeatures.Multiple; var index = DataTypeFeatures.Indexing | DataTypeFeatures.Clustering | DataTypeFeatures.FillFactor | DataTypeFeatures.KeyConstraint; var identity = DataTypeFeatures.Identity; types.Boolean = DataTypeInfo.Range(SqlType.Boolean, common | index, ValueRange.Bool, "bit"); types.UInt8 = DataTypeInfo.Range(SqlType.UInt8, common | index | identity, ValueRange.Byte, "tinyint"); types.Int16 = DataTypeInfo.Range(SqlType.Int16, common | index | identity, ValueRange.Int16, "smallint"); types.Int32 = DataTypeInfo.Range(SqlType.Int32, common | index | identity, ValueRange.Int32, "integer", "int"); types.Int64 = DataTypeInfo.Range(SqlType.Int64, common | index | identity, ValueRange.Int64, "bigint"); types.Decimal = DataTypeInfo.Regular(SqlType.Decimal, common | index, "decimal", "numeric"); types.Float = DataTypeInfo.Range(SqlType.Float, common | index, ValueRange.Float, "real"); types.Double = DataTypeInfo.Range(SqlType.Double, common | index, ValueRange.Double, "float"); types.DateTime = DataTypeInfo.Range(SqlType.DateTime, common | index, ValueRange.DateTime, "datetime"); types.DateTimeOffset = DataTypeInfo.Range(SqlType.DateTimeOffset, common | index, ValueRange.DateTimeOffset, "datetimeoffset"); types.VarCharMax = DataTypeInfo.Regular(SqlType.VarCharMax, common | index, "varchar", "nvarchar", "nchar", "char", "text", "xml"); types.VarBinaryMax = DataTypeInfo.Regular(SqlType.VarBinaryMax, common, "blob"); types.Guid = DataTypeInfo.Regular(SqlType.Guid, common | index, "uniqueidentifier", "guid"); return(types); }
public override DataTypeCollection GetDataTypesInfo() { var commonFeatures = DataTypeFeatures.Clustering | DataTypeFeatures.Grouping | DataTypeFeatures.Indexing | DataTypeFeatures.KeyConstraint | DataTypeFeatures.Nullable | DataTypeFeatures.Ordering | DataTypeFeatures.Multiple | DataTypeFeatures.Default; var dtc = new DataTypeCollection(); dtc.Boolean = DataTypeInfo.Range(SqlType.Boolean, commonFeatures, ValueRange.Bool, "boolean", "bool"); dtc.Int16 = DataTypeInfo.Range(SqlType.Int16, commonFeatures, ValueRange.Int16, "smallint", "int2"); dtc.Int32 = DataTypeInfo.Range(SqlType.Int32, commonFeatures, ValueRange.Int32, "integer", "int4"); dtc.Int64 = DataTypeInfo.Range(SqlType.Int64, commonFeatures, ValueRange.Int64, "bigint", "int8"); dtc.Decimal = DataTypeInfo.Fractional(SqlType.Decimal, commonFeatures, ValueRange.Decimal, 49, "numeric", "decimal"); dtc.Float = DataTypeInfo.Range(SqlType.Float, commonFeatures, ValueRange.Float, "real", "float4"); dtc.Double = DataTypeInfo.Range(SqlType.Double, commonFeatures, ValueRange.Double, "double precision", "float8"); dtc.DateTime = DataTypeInfo.Range(SqlType.DateTime, commonFeatures, ValueRange.DateTime, "timestamp"); dtc.Interval = DataTypeInfo.Range(SqlType.Interval, commonFeatures, ValueRange.TimeSpan, "interval"); dtc.Char = DataTypeInfo.Stream(SqlType.Char, commonFeatures, MaxCharLength, "character", "char", "bpchar"); dtc.VarChar = DataTypeInfo.Stream(SqlType.VarChar, commonFeatures, MaxCharLength, "character varying", "varchar"); dtc.VarCharMax = DataTypeInfo.Regular(SqlType.VarCharMax, commonFeatures, "text"); dtc.VarBinaryMax = DataTypeInfo.Stream(SqlType.VarBinaryMax, commonFeatures, MaxTextLength, "bytea"); dtc.DateTimeOffset = DataTypeInfo.Range(SqlType.DateTimeOffset, commonFeatures, new ValueRange <DateTimeOffset>(new DateTimeOffset(1, 1, 1, 0, 0, 0, 0, new TimeSpan(0)), new DateTimeOffset(9999, 12, 31, 0, 0, 0, 0, new TimeSpan(0))), "timestamptz"); var geo = DataTypeFeatures.Default | DataTypeFeatures.Nullable | DataTypeFeatures.Multiple | DataTypeFeatures.Spatial; dtc.Add(CustomSqlType.Point, DataTypeInfo.Regular(CustomSqlType.Point, geo, "point")); dtc.Add(CustomSqlType.LSeg, DataTypeInfo.Regular(CustomSqlType.LSeg, geo, "lseg")); dtc.Add(CustomSqlType.Box, DataTypeInfo.Regular(CustomSqlType.Box, geo, "box")); dtc.Add(CustomSqlType.Path, DataTypeInfo.Regular(CustomSqlType.Path, geo, "path")); dtc.Add(CustomSqlType.Polygon, DataTypeInfo.Regular(CustomSqlType.Polygon, geo, "polygon")); dtc.Add(CustomSqlType.Circle, DataTypeInfo.Regular(CustomSqlType.Circle, geo, "circle")); return(dtc); }
public static void ParseTypes(AdsStream dataTypeStream, Encoding encoding, IBinder binder, bool buildInTypesInStream, DataTypeCollection <IDataType> buildInTypes) { AdsBinaryReader reader = new AdsBinaryReader(dataTypeStream); string referencedType = null; while (dataTypeStream.Position < dataTypeStream.Length) { AdsDataTypeEntry entry = new AdsDataTypeEntry(true, encoding, reader); try { IDataType type = null; bool flag1 = buildInTypes.TryGetType(entry.entryName, out type); DataType type2 = (DataType)type; if (buildInTypesInStream && flag1) { continue; } DataType type3 = null; int length = 0; if (DataTypeStringParser.TryParseReference(entry.entryName, out referencedType)) { type3 = new ReferenceType(entry, referencedType); } else if (DataTypeStringParser.TryParsePointer(entry.entryName, out referencedType)) { type3 = new PointerType(entry, referencedType); } else { bool flag2; if (DataTypeStringParser.TryParseString(entry.entryName, out length, out flag2)) { type3 = !flag2 ? ((DataType) new StringType(length)) : ((DataType) new WStringType(length)); } else if (entry.methodCount > 0) { type3 = new RpcStructType(entry); } else if (entry.subItems > 0) { bool flag3 = false; bool flag4 = false; if (entry.subItems > 1) { int num2 = 0; AdsFieldEntry[] subEntries = entry.subEntries; int index = 0; while (true) { if (index >= subEntries.Length) { flag3 = entry.BitSize < num2; break; } AdsFieldEntry entry2 = subEntries[index]; if (!entry2.IsStatic && !entry2.IsProperty) { int num4 = 0; num4 = !entry2.IsBitType ? (entry2.Offset * 8) : entry2.Offset; flag4 |= num4 < num2; num2 += entry2.BitSize; } index++; } } type3 = !flag3 ? ((DataType) new StructType(entry)) : ((DataType) new UnionType(entry)); } else if (entry.arrayDim > 0) { type3 = new ArrayType(entry); } else if (entry.enumInfoCount <= 0) { if (DataTypeStringParser.TryParseSubRange(entry.entryName, out referencedType)) { type3 = (DataType)SubRangeTypeFactory.Create(entry, binder); } else if (((entry.baseTypeId > AdsDatatypeId.ADST_VOID) && (entry.typeName != null)) && (entry.typeName != string.Empty)) { type3 = new AliasType(entry); } else { DataTypeCategory cat = CategoryConverter.FromId(entry.DataTypeId); if (cat != DataTypeCategory.Unknown) { Type tp = null; if (PrimitiveTypeConverter.TryGetManagedType(entry.DataTypeId, out tp)) { if (cat == DataTypeCategory.Primitive) { type3 = new PrimitiveType(entry, PrimitiveTypeConverter.GetPrimitiveFlags(entry.DataTypeId), tp); } else if (cat == DataTypeCategory.String) { type3 = new StringType(entry); } } } if (type3 == null) { type3 = new DataType(cat, entry); } } } else { AdsDatatypeId baseTypeId = entry.baseTypeId; if (baseTypeId == AdsDatatypeId.ADST_INT16) { type3 = new EnumType <short>(entry); } else if (baseTypeId == AdsDatatypeId.ADST_INT32) { type3 = new EnumType <int>(entry); } else { switch (baseTypeId) { case AdsDatatypeId.ADST_INT8: type3 = new EnumType <sbyte>(entry); break; case AdsDatatypeId.ADST_UINT8: type3 = new EnumType <byte>(entry); break; case AdsDatatypeId.ADST_UINT16: type3 = new EnumType <ushort>(entry); break; case AdsDatatypeId.ADST_UINT32: type3 = new EnumType <uint>(entry); break; case AdsDatatypeId.ADST_INT64: type3 = new EnumType <long>(entry); break; case AdsDatatypeId.ADST_UINT64: type3 = new EnumType <ulong>(entry); break; default: throw new AdsException("Enum base type mismatch!"); } } } } binder.RegisterType(type3); } catch (Exception exception) { Module.Trace.TraceWarning($"Cannot parse DataTypeEntry. Skipping dataType '{entry.entryName}'!", exception); } } }