Esempio n. 1
0
            public override bool IsValidFor(DataSchema dataSchema, Type propertyType)
            {
                if (null == propertyType)
                {
                    return(false);
                }
                var columnType = dataSchema.GetWrappedValueType(propertyType);

                columnType = Nullable.GetUnderlyingType(columnType) ?? columnType;
                return(convertibleTypes.ContainsKey(columnType) && columnType != typeof(string) && columnType != typeof(bool));
            }
Esempio n. 2
0
            public override bool IsValidFor(DataSchema dataSchema, Type columnType)
            {
                var type = dataSchema.GetWrappedValueType(columnType);

                if (typeof(IFormattable).IsAssignableFrom(type))
                {
                    return(false);
                }
                if (type.IsPrimitive)
                {
                    return(false);
                }
                return(true);
            }
Esempio n. 3
0
        public static Type GetTypeToConvertOperandTo(DataSchema dataSchema, Type columnType)
        {
            if (null == columnType)
            {
                return(typeof(string));
            }
            columnType = dataSchema.GetWrappedValueType(columnType);
            columnType = Nullable.GetUnderlyingType(columnType) ?? columnType;
            Type typeToConvertTo;

            if (convertibleTypes.TryGetValue(columnType, out typeToConvertTo))
            {
                return(typeToConvertTo);
            }
            return(typeof(string));
        }
Esempio n. 4
0
 public override bool IsValidForType(DataSchema dataSchema, Type type)
 {
     type = dataSchema.GetWrappedValueType(type);
     return(TypeDescriptor.GetConverter(type).CanConvertTo(typeof(double)));
 }
Esempio n. 5
0
 public override bool IsValidFor(DataSchema dataSchema, Type propertyType)
 {
     if (null == propertyType)
     {
         return false;
     }
     var columnType = dataSchema.GetWrappedValueType(propertyType);
     columnType = Nullable.GetUnderlyingType(columnType) ?? columnType;
     return convertibleTypes.ContainsKey(columnType) && columnType != typeof (string) && columnType != typeof(bool);
 }
Esempio n. 6
0
 public override bool IsValidFor(DataSchema dataSchema, Type columnType)
 {
     return typeof (string) == dataSchema.GetWrappedValueType(columnType);
 }
Esempio n. 7
0
 public static Type GetTypeToConvertOperandTo(DataSchema dataSchema, Type columnType)
 {
     if (null == columnType)
     {
         return typeof (string);
     }
     columnType = dataSchema.GetWrappedValueType(columnType);
     columnType = Nullable.GetUnderlyingType(columnType) ?? columnType;
     Type typeToConvertTo;
     if (convertibleTypes.TryGetValue(columnType, out typeToConvertTo))
     {
         return typeToConvertTo;
     }
     return typeof (string);
 }
Esempio n. 8
0
 public override bool IsValidFor(DataSchema dataSchema, Type columnType)
 {
     return(typeof(string) == dataSchema.GetWrappedValueType(columnType));
 }