public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { object result = null; XBinVector3 vector3 = (XBinVector3)value; if (destinationType == typeof(string)) { result = vector3.ToString(); } return(result ?? base.ConvertTo(context, culture, value, destinationType)); }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { object result = null; string stringValue = value as string; if (!string.IsNullOrEmpty(stringValue)) { float[] values = ConverterUtils.ConvertStringToFloats(stringValue, 3); result = new XBinVector3(values); } return(result ?? base.ConvertFrom(context, culture, value)); }