internal NormalizedSerializer(Type t) : base(t) { SqlUserDefinedTypeAttribute udtAttr = SerializationHelperSql9.GetUdtAttribute(t); _normalizer = new BinaryOrderedUdtNormalizer(t, true); _isFixedSize = udtAttr.IsFixedLength; _maxSize = _normalizer.Size; }
internal static Normalizer GetNormalizer(Type t) { Normalizer n = null; if (t.IsPrimitive) { if (t == typeof(byte)) n = new ByteNormalizer(); else if (t == typeof(sbyte)) n = new SByteNormalizer(); else if (t == typeof(bool)) n = new BooleanNormalizer(); else if (t == typeof(short)) n = new ShortNormalizer(); else if (t == typeof(ushort)) n = new UShortNormalizer(); else if (t == typeof(int)) n = new IntNormalizer(); else if (t == typeof(uint)) n = new UIntNormalizer(); else if (t == typeof(float)) n = new FloatNormalizer(); else if (t == typeof(double)) n = new DoubleNormalizer(); else if (t == typeof(long)) n = new LongNormalizer(); else if (t == typeof(ulong)) n = new ULongNormalizer(); } else if (t.IsValueType) { n = new BinaryOrderedUdtNormalizer(t, false); } if (n == null) throw new Exception(StringsHelper.GetString(Strings.SQL_CannotCreateNormalizer, t.FullName)); n._skipNormalize = false; return n; }
internal NormalizedSerializer(Type t) : base(t) { _ = SerializationHelperSql9.GetUdtAttribute(t); _normalizer = new BinaryOrderedUdtNormalizer(t, true); }