System.ComponentModel.TypeConverter

Provides a unified way of converting types of values to other types, as well as for accessing standard values and subproperties.


Inherits from: System.Object

Constructors

Signature Description
New ()

Methods

Method Name Description
CanConvertFrom(sourceType As Type) As Boolean Returns whether this converter can convert an object of the given type to the type of this converter.
Parameters
sourceType
          Type: Type
          A that represents the type you want to convert from.
CanConvertFrom(context As ITypeDescriptorContext, sourceType As Type) As Boolean Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
sourceType
          Type: Type
          A that represents the type you want to convert from.
CanConvertTo(destinationType As Type) As Boolean Returns whether this converter can convert the object to the specified type.
Parameters
destinationType
          Type: Type
          A that represents the type you want to convert to.
CanConvertTo(context As ITypeDescriptorContext, destinationType As Type) As Boolean Returns whether this converter can convert the object to the specified type, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
destinationType
          Type: Type
          A that represents the type you want to convert to.
ConvertFrom(value As Object) As Object Converts the given value to the type of this converter.
Parameters
value
          Type: Object
          The to convert.
ConvertFrom(context As ITypeDescriptorContext, culture As CultureInfo, value As Object) As Object Converts the given object to the type of this converter, using the specified context and culture information.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
culture
          Type: CultureInfo
          The to use as the current culture.
 
value
          Type: Object
          The to convert.
ConvertFromInvariantString(text As String) As Object Converts the given string to the type of this converter, using the invariant culture.
Parameters
text
          Type: String
          The to convert.
ConvertFromInvariantString(context As ITypeDescriptorContext, text As String) As Object Converts the given string to the type of this converter, using the invariant culture and the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
text
          Type: String
          The to convert.
ConvertFromString(text As String) As Object Converts the specified text to an object.
Parameters
text
          Type: String
          The text representation of the object to convert.
ConvertFromString(context As ITypeDescriptorContext, text As String) As Object Converts the given text to an object, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
text
          Type: String
          The to convert.
ConvertFromString(context As ITypeDescriptorContext, culture As CultureInfo, text As String) As Object Converts the given text to an object, using the specified context and culture information.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
culture
          Type: CultureInfo
          A . If null is passed, the current culture is assumed.
 
text
          Type: String
          The to convert.
ConvertTo(value As Object, destinationType As Type) As Object Converts the given value object to the specified type, using the arguments.
Parameters
value
          Type: Object
          The to convert.
 
destinationType
          Type: Type
          The to convert the parameter to.
ConvertTo(context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object Converts the given value object to the specified type, using the specified context and culture information.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
culture
          Type: CultureInfo
          A . If null is passed, the current culture is assumed.
 
value
          Type: Object
          The to convert.
 
destinationType
          Type: Type
          The to convert the parameter to.
ConvertToInvariantString(value As Object) As String Converts the specified value to a culture-invariant string representation.
Parameters
value
          Type: Object
          The to convert.
ConvertToInvariantString(context As ITypeDescriptorContext, value As Object) As String Converts the specified value to a culture-invariant string representation, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
value
          Type: Object
          The to convert.
ConvertToString(value As Object) As String Converts the specified value to a string representation.
Parameters
value
          Type: Object
          The to convert.
ConvertToString(context As ITypeDescriptorContext, value As Object) As String Converts the given value to a string representation, using the given context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
value
          Type: Object
          The to convert.
ConvertToString(context As ITypeDescriptorContext, culture As CultureInfo, value As Object) As String Converts the given value to a string representation, using the specified context and culture information.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
culture
          Type: CultureInfo
          A . If null is passed, the current culture is assumed.
 
value
          Type: Object
          The to convert.
CreateInstance(propertyValues As IDictionary) As Object Re-creates an object given a set of property values for the object.
Parameters
propertyValues
          Type: IDictionary
          An that represents a dictionary of new property values.
CreateInstance(context As ITypeDescriptorContext, propertyValues As IDictionary) As Object Creates an instance of the type that this is associated with, using the specified context, given a set of property values for the object.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
propertyValues
          Type: IDictionary
          An of new property values.
GetConvertFromException(value As Object) As Exception Returns an exception to throw when a conversion cannot be performed.
Parameters
value
          Type: Object
          The to convert, or null if the object is not available.
GetConvertToException(value As Object, destinationType As Type) As Exception Returns an exception to throw when a conversion cannot be performed.
Parameters
value
          Type: Object
          The to convert, or null if the object is not available.
 
destinationType
          Type: Type
          A that represents the type the conversion was trying to convert to.
GetCreateInstanceSupported() As Boolean Returns whether changing a value on this object requires a call to the method to create a new value.
GetCreateInstanceSupported(context As ITypeDescriptorContext) As Boolean Returns whether changing a value on this object requires a call to to create a new value, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
GetProperties(value As Object) As PropertyDescriptorCollection Returns a collection of properties for the type of array specified by the value parameter.
Parameters
value
          Type: Object
          An that specifies the type of array for which to get properties.
GetProperties(context As ITypeDescriptorContext, value As Object) As PropertyDescriptorCollection Returns a collection of properties for the type of array specified by the value parameter, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
value
          Type: Object
          An that specifies the type of array for which to get properties.
GetProperties(context As ITypeDescriptorContext, value As Object, attributes() As Attribute()) As PropertyDescriptorCollection Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
value
          Type: Object
          An that specifies the type of array for which to get properties.
 
attributes
          Type: Attribute
          An array of type that is used as a filter.
GetPropertiesSupported() As Boolean Returns whether this object supports properties.
GetPropertiesSupported(context As ITypeDescriptorContext) As Boolean Returns whether this object supports properties, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
GetStandardValues() As ICollection Returns a collection of standard values from the default context for the data type this type converter is designed for.
GetStandardValues(context As ITypeDescriptorContext) As StandardValuesCollection Returns a collection of standard values for the data type this type converter is designed for when provided with a format context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null.
GetStandardValuesExclusive() As Boolean Returns whether the collection of standard values returned from is an exclusive list.
GetStandardValuesExclusive(context As ITypeDescriptorContext) As Boolean Returns whether the collection of standard values returned from is an exclusive list of possible values, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
GetStandardValuesSupported() As Boolean Returns whether this object supports a standard set of values that can be picked from a list.
GetStandardValuesSupported(context As ITypeDescriptorContext) As Boolean Returns whether this object supports a standard set of values that can be picked from a list, using the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
IsValid(value As Object) As Boolean Returns whether the given value object is valid for this type.
Parameters
value
          Type: Object
          The object to test for validity.
IsValid(context As ITypeDescriptorContext, value As Object) As Boolean Returns whether the given value object is valid for this type and for the specified context.
Parameters
context
          Type: ITypeDescriptorContext
          An that provides a format context.
 
value
          Type: Object
          The to test for validity.
SortProperties(props As PropertyDescriptorCollection, names() As String()) As PropertyDescriptorCollection Sorts a collection of properties.
Parameters
props
          Type: PropertyDescriptorCollection
          A that has the properties to sort.
 
names
          Type: String
          An array of names in the order you want the properties to appear in the collection.