internal NormalizedSerializer(Type t) : base(t)
 {
     SqlUserDefinedTypeAttribute udtAttribute = SerializationHelperSql9.GetUdtAttribute(t);
     this.m_normalizer = new BinaryOrderedUdtNormalizer(t, true);
     this.m_isFixedSize = udtAttribute.IsFixedLength;
     this.m_maxSize = this.m_normalizer.Size;
 }
Ejemplo n.º 2
0
        internal NormalizedSerializer(Type t) : base(t)
        {
            SqlUserDefinedTypeAttribute udtAttribute = SerializationHelperSql9.GetUdtAttribute(t);

            this.m_normalizer  = new BinaryOrderedUdtNormalizer(t, true);
            this.m_isFixedSize = udtAttribute.IsFixedLength;
            this.m_maxSize     = this.m_normalizer.Size;
        }
 internal static Normalizer GetNormalizer(Type t)
 {
     Normalizer normalizer = null;
     if (t.IsPrimitive)
     {
         if (t == typeof(byte))
         {
             normalizer = new ByteNormalizer();
         }
         else if (t == typeof(sbyte))
         {
             normalizer = new SByteNormalizer();
         }
         else if (t == typeof(bool))
         {
             normalizer = new BooleanNormalizer();
         }
         else if (t == typeof(short))
         {
             normalizer = new ShortNormalizer();
         }
         else if (t == typeof(ushort))
         {
             normalizer = new UShortNormalizer();
         }
         else if (t == typeof(int))
         {
             normalizer = new IntNormalizer();
         }
         else if (t == typeof(uint))
         {
             normalizer = new UIntNormalizer();
         }
         else if (t == typeof(float))
         {
             normalizer = new FloatNormalizer();
         }
         else if (t == typeof(double))
         {
             normalizer = new DoubleNormalizer();
         }
         else if (t == typeof(long))
         {
             normalizer = new LongNormalizer();
         }
         else if (t == typeof(ulong))
         {
             normalizer = new ULongNormalizer();
         }
     }
     else if (t.IsValueType)
     {
         normalizer = new BinaryOrderedUdtNormalizer(t, false);
     }
     if (normalizer == null)
     {
         throw new Exception(Res.GetString("Sql_CanotCreateNormalizer", new object[] { t.FullName }));
     }
     normalizer.m_skipNormalize = false;
     return normalizer;
 }
Ejemplo n.º 4
0
        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(SR.GetString(SR.SQL_CannotCreateNormalizer, t.FullName));
            }
            n._skipNormalize = false;
            return(n);
        }
Ejemplo n.º 5
0
        internal static Normalizer GetNormalizer(Type t)
        {
            Normalizer normalizer = null;

            if (t.IsPrimitive)
            {
                if (t == typeof(byte))
                {
                    normalizer = new ByteNormalizer();
                }
                else if (t == typeof(sbyte))
                {
                    normalizer = new SByteNormalizer();
                }
                else if (t == typeof(bool))
                {
                    normalizer = new BooleanNormalizer();
                }
                else if (t == typeof(short))
                {
                    normalizer = new ShortNormalizer();
                }
                else if (t == typeof(ushort))
                {
                    normalizer = new UShortNormalizer();
                }
                else if (t == typeof(int))
                {
                    normalizer = new IntNormalizer();
                }
                else if (t == typeof(uint))
                {
                    normalizer = new UIntNormalizer();
                }
                else if (t == typeof(float))
                {
                    normalizer = new FloatNormalizer();
                }
                else if (t == typeof(double))
                {
                    normalizer = new DoubleNormalizer();
                }
                else if (t == typeof(long))
                {
                    normalizer = new LongNormalizer();
                }
                else if (t == typeof(ulong))
                {
                    normalizer = new ULongNormalizer();
                }
            }
            else if (t.IsValueType)
            {
                normalizer = new BinaryOrderedUdtNormalizer(t, false);
            }
            if (normalizer == null)
            {
                throw new Exception(Res.GetString("Sql_CanotCreateNormalizer", new object[] { t.FullName }));
            }
            normalizer.m_skipNormalize = false;
            return(normalizer);
        }