Exemplo n.º 1
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);
        }
 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;
 }
Exemplo n.º 3
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);
        }