| 206 | return new PointF(numArray[0], numArray[1]); |
| 207 | } |
| 208 | public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) |
| 209 | { |
| 210 | if (culture == null) |
| 211 | culture = CultureInfo.CurrentCulture; |
| 212 | if (destinationType == null) |
| 213 | throw new ArgumentNullException("destinationType"); |
| 214 | |
| 215 | if ((destinationType == typeof(string)) && (value is PointF)) |
| 216 | { |
| 217 | PointF pointf = (PointF)value; |
| 218 | |
| 219 | string separator = culture.TextInfo.ListSeparator + " "; |
| 220 | TypeConverter converter = TypeDescriptor.GetConverter(typeof(float)); |
| 221 | string[] textArray = new string[2]; |
| 222 | int num = 0; |
| 223 | textArray[num++] = converter.ConvertToString(context, culture, pointf.X); |
| 224 | textArray[num++] = converter.ConvertToString(context, culture, pointf.Y); |
| 225 | return string.Join(separator, textArray); |
| 226 | } |
| 227 | |
| 228 | return base.ConvertTo(context, culture, value, destinationType); |
| 229 | } |
| 230 | public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) |
| 231 | { |
| 232 | return new PointF((float)propertyValues["X"], (float)propertyValues["Y"]); |