12 private static readonly
string[]
s_propertySort =
new string[2] {
"Width",
"Height" };
16 if (!(sourceType == typeof(
string)))
18 return base.CanConvertFrom(context, sourceType);
27 return base.CanConvertTo(context, destinationType);
36 string text2 =
text.Trim();
37 if (text2.Length == 0)
45 char separator =
culture.TextInfo.ListSeparator[0];
46 string[]
array = text2.Split(separator);
47 float[] array2 =
new float[
array.Length];
49 for (
int i = 0; i < array2.Length; i++)
53 if (array2.Length != 2)
57 return new SizeF(array2[0], array2[1]);
64 if (destinationType ==
null)
70 if (destinationType == typeof(
string))
76 string separator = culture.TextInfo.ListSeparator +
" ";
78 string[] value2 =
new string[2]
83 return string.Join(separator, value2);
92 if (constructor !=
null)
94 return new InstanceDescriptor(constructor,
new object[2] { sizeF.Width, sizeF.Height });
98 return base.ConvertTo(context,
culture,
value, destinationType);
103 if (propertyValues ==
null)
107 object obj = propertyValues[
"Width"];
108 object obj2 = propertyValues[
"Height"];
109 if (
obj ==
null || obj2 ==
null || !(
obj is
float) || !(obj2 is
float))
113 return new SizeF((
float)
obj, (
float)obj2);
121 [RequiresUnreferencedCode(
"The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
virtual PropertyDescriptorCollection Sort()
string? ConvertToString(object? value)
object? ConvertFromString(string text)
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static TypeConverter GetConverterTrimUnsafe([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
override bool GetPropertiesSupported(ITypeDescriptorContext? context)
override object CreateInstance(ITypeDescriptorContext? context, IDictionary propertyValues)
override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
override? object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
override? object ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext? context, object value, Attribute[]? attributes)
override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
override bool GetCreateInstanceSupported(ITypeDescriptorContext? context)
static readonly string[] s_propertySort
static CultureInfo CurrentCulture
static string PropertyValueInvalidEntry
static string Format(string resourceFormat, object p1)
static string TextParseFailedFormat