示例#1
0
            public override bool IsValid(ITypeDescriptorContext context, object value)
            {
                object result;

                return(Converter.TryConvert(value, convObj.GetType(), out result));
            }
示例#2
0
 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
 {
     return(Converter.Convert(convObj, destinationType));
 }
示例#3
0
 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
 {
     return(Converter.CanConvertFrom(sourceType, convObj.GetType(), NarrowingLevel.All, true));
 }
示例#4
0
 public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
 {
     return(Converter.Convert(value, convObj.GetType()));
 }
示例#5
0
            public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
            {
                object result;

                return(Converter.TryConvert(convObj, destinationType, out result));
            }