12 private static readonly
string[]
s_propertySort =
new string[4] {
"X",
"Y",
"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 != 4)
57 return new Rectangle(array2[0], array2[1], array2[2], array2[3]);
64 if (destinationType ==
null)
70 if (destinationType == typeof(
string))
76 string separator = culture.TextInfo.ListSeparator +
" ";
78 string[] value2 =
new string[4]
85 return string.Join(separator, value2);
96 if (constructor !=
null)
98 return new InstanceDescriptor(constructor,
new object[4] { rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height });
102 return base.ConvertTo(context,
culture,
value, destinationType);
107 if (propertyValues ==
null)
111 object obj = propertyValues[
"X"];
112 object obj2 = propertyValues[
"Y"];
113 object obj3 = propertyValues[
"Width"];
114 object obj4 = propertyValues[
"Height"];
115 if (
obj ==
null || obj2 ==
null || obj3 ==
null || obj4 ==
null || !(
obj is
int) || !(obj2 is
int) || !(obj3 is
int) || !(obj4 is
int))
119 return new Rectangle((
int)
obj, (
int)obj2, (
int)obj3, (
int)obj4);
127 [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 ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
override bool GetPropertiesSupported(ITypeDescriptorContext? context)
override bool GetCreateInstanceSupported(ITypeDescriptorContext? context)
override object CreateInstance(ITypeDescriptorContext? context, IDictionary propertyValues)
override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext? context, object? value, Attribute[]? attributes)
static readonly string[] s_propertySort
override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
override? object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
static CultureInfo CurrentCulture
static string PropertyValueInvalidEntry
static string Format(string resourceFormat, object p1)
static string TextParseFailedFormat