public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (ConditionalAutoLengthConverter.IsSilverlightProject(context)) { string str = value as string; if (str != null && ConditionalAutoLengthConverter.IsEquivalentToAuto(str)) { throw new FormatException(); } } return(base.ConvertFrom(context, culture, value)); }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { object obj = base.ConvertTo(context, culture, value, destinationType); if (ConditionalAutoLengthConverter.IsSilverlightProject(context)) { string str = value as string; if (str != null && ConditionalAutoLengthConverter.IsEquivalentToAuto(str)) { obj = ""; } } return(obj); }