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 int[] array2 =
new int[
array.Length];
49 for (
int i = 0; i < array2.Length; i++)
53 if (array2.Length != 2)
57 return new Size(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)
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
int) || !(obj2 is
int))
113 return new Size((
int)
obj, (
int)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 object CreateInstance(ITypeDescriptorContext? context, IDictionary propertyValues)
static readonly string[] s_propertySort
override? object ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
override bool GetPropertiesSupported(ITypeDescriptorContext? context)
override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
override? object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
override bool GetCreateInstanceSupported(ITypeDescriptorContext? context)
override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext? context, object value, Attribute[]? attributes)
static CultureInfo CurrentCulture
static string PropertyValueInvalidEntry
static string Format(string resourceFormat, object p1)
static string TextParseFailedFormat