RectangleConverter

TypeConverter
Converter for the Rectangle class
Remarks: Allows for conversion from a string to a Rectangle.
obsolete. Use TypeDescriptor.GetConverter instead

Methods

CanConvertFrom

#
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Determines if this converter can convert from the specified sourceType
context (ITypeDescriptorContext)Conversion context
sourceType (Type)Type to convert from
True if this converter can convert from the specified type, false otherwise

CanConvertFrom

public bool CanConvertFrom(Type sourceType)
Determines whether this instance can convert from the specified sourceType.
inherited fromTypeConverter
sourceType (Type)Source type to convert from.
true if this instance can convert from the specified sourceType; otherwise, false.

CanConvertTo

public virtual bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Determines whether this instance can convert to the specified context destinationType.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
destinationType (Type)Destination type.
true if this instance can convert to the specified context destinationType; otherwise, false.

CanConvertTo

public bool CanConvertTo(Type destinationType)
Determines whether this instance can convert to the specified destinationType.
inherited fromTypeConverter
destinationType (Type)Destination type.
true if this instance can convert to the specified destinationType; otherwise, false.

ConvertFrom

#
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Converts the specified value to a Rectangle
context (ITypeDescriptorContext)Conversion context
culture (CultureInfo)Culture to perform the conversion
value (object)Value to convert
A new instance of a Rectangle converted from the specified value

ConvertFrom

public object ConvertFrom(object o)
Converts from the specified object.
inherited fromTypeConverter

ConvertFromInvariantString

public object ConvertFromInvariantString(ITypeDescriptorContext context, string text)
Converts from an invariant string.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
text (string)Text to convert.
The from invariant string.

ConvertFromInvariantString

public object ConvertFromInvariantString(string text)
Converts from an invariant string.
inherited fromTypeConverter

ConvertFromString

public object ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, string text)
Converts from string.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
culture (CultureInfo)Culture.
text (string)Text to convert.
The converted object.

ConvertFromString

public object ConvertFromString(ITypeDescriptorContext context, string text)
Converts from string.
inherited fromTypeConverter

ConvertFromString

public object ConvertFromString(string text)
Converts from string.
inherited fromTypeConverter

ConvertTo

public virtual object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converts to the specified type.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
culture (CultureInfo)Culture.
value (object)Value to convert.
destinationType (Type)Destination type to convert to.
The converted object.

ConvertTo

public object ConvertTo(object value, Type destinationType)
Converts to the specified type.
inherited fromTypeConverter
value (object)Value to convert.
destinationType (Type)Destination type to convert to.
The converted object.

ConvertToInvariantString

public string ConvertToInvariantString(ITypeDescriptorContext context, object value)
Converts to invariant string.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
value (object)Value to convert.
The converted string.

ConvertToInvariantString

public string ConvertToInvariantString(object value)
Converts to an invariant string.
inherited fromTypeConverter

ConvertToString

public string ConvertToString(ITypeDescriptorContext context, CultureInfo culture, object value)
Converts to a string.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
culture (CultureInfo)Culture.
value (object)Value to convert.
The converted string.

ConvertToString

public string ConvertToString(ITypeDescriptorContext context, object value)
Converts to a string.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
value (object)Value to convert.
The converted string.

ConvertToString

public string ConvertToString(object value)
Converts to a string.
inherited fromTypeConverter

GetConvertFromException

protected Exception GetConvertFromException(object value)
Gets the exception when converting from a value.
inherited fromTypeConverter
value (object)Value converted from.
The convert from exception.

GetConvertToException

protected Exception GetConvertToException(object value, Type destinationType)
Gets the exception when converting to a value.
inherited fromTypeConverter
value (object)Value converting to.
destinationType (Type)Destination type.
The convert to exception.

IsValid

public virtual bool IsValid(ITypeDescriptorContext context, object value)
Determines whether this instance is valid the specified context value.
inherited fromTypeConverter
context (ITypeDescriptorContext)Context.
value (object)Value.
true if this instance is valid the specified context value; otherwise, false.

IsValid

public bool IsValid(object value)
Determines whether this instance is valid the specified value.
inherited fromTypeConverter
value (object)Value.
true if this instance is valid the specified value; otherwise, false.