public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == (Type)null) { throw new ArgumentNullException("destinationType"); } if (value != null && value is SplitterLength) { SplitterLength length = (SplitterLength)value; if (destinationType == typeof(string)) { return((object)SplitterLengthConverter.ToString(length, culture)); } if (destinationType == typeof(InstanceDescriptor)) { return((object)new InstanceDescriptor((MemberInfo)typeof(SplitterLength).GetConstructor(new Type[2] { typeof(double), typeof(SplitterUnitType) }), (ICollection) new object[2] { (object)length.Value, (object)length.SplitterUnitType })); } } throw this.GetConvertToException(value, destinationType); }
public override string ToString() { return(SplitterLengthConverter.ToString(this, CultureInfo.InvariantCulture)); }