Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​ComponentModel.​VersionConverter

Assembly: System.ComponentModel.TypeConverter

Inheritance: object → TypeConverter → VersionConverter

Provides a type converter to convert <see cref="T:System.Version" /> objects to and from various other representations.

Methods

public bool
CanConvertFrom​(ITypeDescriptorContext? context, Type sourceType)
Gets a value indicating whether this converter can convert an object in the given source type to a <see cref="T:System.Version" /> .
Returns <see langword="true" /> if this converter can convert sourceType to a <see cref="T:System.Version" /> ; otherwise, <see langword="false" /> .
context An object that provides contextual information.
sourceType The type of the object to be converted.
public bool
CanConvertTo​(ITypeDescriptorContext context, Type destinationType)
Gets a value indicating whether this converter can convert an object to the given destination type using the context.
Returns <see langword="true" /> if the converter can convert an object to the given destination type; otherwise, <see langword="false" /> .
context An object that provides contextual information.
destinationType The target type for the conversion.
public object
ConvertFrom​(ITypeDescriptorContext context, Globalization.​CultureInfo culture, object value)
Converts the specified object to a <see cref="T:System.Version" /> .
Returns <paramref name="value" /> converted to a <see cref="T:System.Version" /> value.
context An object that provides contextual information.
culture The culture to use for the conversion.
value The value to convert to a <see cref="T:System.Version" /> .
public object
ConvertTo​(ITypeDescriptorContext context, Globalization.​CultureInfo culture, object value, Type destinationType)
Converts the specified value to the specified destination type using the specified context and arguments.
Returns An object that represents the converted value.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
culture The culture that supplies formatting information for the conversion.
value The value to be converted.
destinationType The type to convert the value parameter to.
public bool
IsValid​(ITypeDescriptorContext context, object value)
Returns a value that indicates whether the given value object is valid for this type and for the specified context.
Returns <see langword="true" /> if the specified value is valid for this object; otherwise, <see langword="false" /> .
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
value The object to test for validity.
public bool
CanConvertFrom​(Type sourceType)
Inherited from TypeConverter
Returns whether this converter can convert an object of the given type to the type of this converter.
Returns <see langword="true" /> if this converter can perform the conversion; otherwise, <see langword="false" /> .
sourceType A <see cref="T:System.Type" /> that represents the type you want to convert from.
public bool
CanConvertTo​(Type destinationType)
Inherited from TypeConverter
Returns whether this converter can convert the object to the specified type.
Returns <see langword="true" /> if this converter can perform the conversion; otherwise, <see langword="false" /> .
destinationType A <see cref="T:System.Type" /> that represents the type you want to convert to.
public object
ConvertFrom​(object value)
Inherited from TypeConverter
Converts the given value to the type of this converter.
Returns An <see cref="T:System.Object" /> that represents the converted value.
value The <see cref="T:System.Object" /> to convert.
public object
ConvertFromInvariantString​(ITypeDescriptorContext context, string text)
Inherited from TypeConverter
Converts the given string to the type of this converter, using the invariant culture and the specified context.
Returns An <see cref="T:System.Object" /> that represents the converted text.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
text The <see cref="T:System.String" /> to convert.
public object
ConvertFromInvariantString​(string text)
Inherited from TypeConverter
Converts the given string to the type of this converter, using the invariant culture.
Returns An <see cref="T:System.Object" /> that represents the converted text.
text The <see cref="T:System.String" /> to convert.
public object
ConvertFromString​(ITypeDescriptorContext context, Globalization.​CultureInfo culture, string text)
Inherited from TypeConverter
Converts the given text to an object, using the specified context and culture information.
Returns An <see cref="T:System.Object" /> that represents the converted text.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
culture A <see cref="T:System.Globalization.CultureInfo" /> . If <see langword="null" /> is passed, the current culture is assumed.
text The <see cref="T:System.String" /> to convert.
public object
ConvertFromString​(ITypeDescriptorContext context, string text)
Inherited from TypeConverter
Converts the given text to an object, using the specified context.
Returns An <see cref="T:System.Object" /> that represents the converted text.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
text The <see cref="T:System.String" /> to convert.
public object
ConvertFromString​(string text)
Inherited from TypeConverter
Converts the specified text to an object.
Returns An <see cref="T:System.Object" /> that represents the converted text.
text The text representation of the object to convert.
public object
ConvertTo​(object value, Type destinationType)
Inherited from TypeConverter
Converts the given value object to the specified type, using the arguments.
Returns An <see cref="T:System.Object" /> that represents the converted value.
value The <see cref="T:System.Object" /> to convert.
destinationType The <see cref="T:System.Type" /> to convert the <paramref name="value" /> parameter to.
public string
ConvertToInvariantString​(ITypeDescriptorContext context, object value)
Inherited from TypeConverter
Converts the specified value to a culture-invariant string representation, using the specified context.
Returns A <see cref="T:System.String" /> that represents the converted value.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
value The <see cref="T:System.Object" /> to convert.
public string
ConvertToInvariantString​(object value)
Inherited from TypeConverter
Converts the specified value to a culture-invariant string representation.
Returns A <see cref="T:System.String" /> that represents the converted value.
value The <see cref="T:System.Object" /> to convert.
public string
ConvertToString​(ITypeDescriptorContext context, Globalization.​CultureInfo culture, object value)
Inherited from TypeConverter
Converts the given value to a string representation, using the specified context and culture information.
Returns An <see cref="T:System.Object" /> that represents the converted value.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
culture A <see cref="T:System.Globalization.CultureInfo" /> . If <see langword="null" /> is passed, the current culture is assumed.
value The <see cref="T:System.Object" /> to convert.
public string
ConvertToString​(ITypeDescriptorContext context, object value)
Inherited from TypeConverter
Converts the given value to a string representation, using the given context.
Returns An <see cref="T:System.Object" /> that represents the converted value.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
value The <see cref="T:System.Object" /> to convert.
public string
ConvertToString​(object value)
Inherited from TypeConverter
Converts the specified value to a string representation.
Returns An <see cref="T:System.Object" /> that represents the converted value.
value The <see cref="T:System.Object" /> to convert.
public object
CreateInstance​(Collections.​IDictionary propertyValues)
Inherited from TypeConverter
Re-creates an <see cref="T:System.Object" /> given a set of property values for the object.
Returns An <see cref="T:System.Object" /> representing the given <see cref="T:System.Collections.IDictionary" /> , or <see langword="null" /> if the object cannot be created. This method always returns <see langword="null" /> .
propertyValues An <see cref="T:System.Collections.IDictionary" /> that represents a dictionary of new property values.
public object
CreateInstance​(ITypeDescriptorContext context, Collections.​IDictionary propertyValues)
Inherited from TypeConverter
Creates an instance of the type that this <see cref="T:System.ComponentModel.TypeConverter" /> is associated with, using the specified context, given a set of property values for the object.
Returns An <see cref="T:System.Object" /> representing the given <see cref="T:System.Collections.IDictionary" /> , or <see langword="null" /> if the object cannot be created. This method always returns <see langword="null" /> .
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
propertyValues An <see cref="T:System.Collections.IDictionary" /> of new property values.
protected Exception
GetConvertFromException​(object value)
Inherited from TypeConverter
Returns an exception to throw when a conversion cannot be performed.
Returns An <see cref="T:System.Exception" /> that represents the exception to throw when a conversion cannot be performed.
value The <see cref="T:System.Object" /> to convert, or <see langword="null" /> if the object is not available.
protected Exception
GetConvertToException​(object value, Type destinationType)
Inherited from TypeConverter
Returns an exception to throw when a conversion cannot be performed.
Returns An <see cref="T:System.Exception" /> that represents the exception to throw when a conversion cannot be performed.
value The <see cref="T:System.Object" /> to convert, or <see langword="null" /> if the object is not available.
destinationType A <see cref="T:System.Type" /> that represents the type the conversion was trying to convert to.
public bool
GetCreateInstanceSupported​()
Inherited from TypeConverter
Returns whether changing a value on this object requires a call to the <see cref="M:System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary)" /> method to create a new value.
Returns <see langword="true" /> if changing a property on this object requires a call to <see cref="M:System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary)" /> to create a new value; otherwise, <see langword="false" /> .
public bool
GetCreateInstanceSupported​(ITypeDescriptorContext context)
Inherited from TypeConverter
Returns whether changing a value on this object requires a call to <see cref="M:System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary)" /> to create a new value, using the specified context.
Returns <see langword="true" /> if changing a property on this object requires a call to <see cref="M:System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary)" /> to create a new value; otherwise, <see langword="false" /> .
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
GetProperties​(ITypeDescriptorContext context, object value)
Inherited from TypeConverter
Returns a collection of properties for the type of array specified by the value parameter, using the specified context.
Returns A <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> with the properties that are exposed for this data type, or <see langword="null" /> if there are no properties.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
value An <see cref="T:System.Object" /> that specifies the type of array for which to get properties.
GetProperties​(ITypeDescriptorContext context, object value, Attribute[] attributes)
Inherited from TypeConverter
Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.
Returns A <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> with the properties that are exposed for this data type, or <see langword="null" /> if there are no properties.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
value An <see cref="T:System.Object" /> that specifies the type of array for which to get properties.
attributes An array of type <see cref="T:System.Attribute" /> that is used as a filter.
GetProperties​(object value)
Inherited from TypeConverter
Returns a collection of properties for the type of array specified by the value parameter.
Returns A <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> with the properties that are exposed for this data type, or <see langword="null" /> if there are no properties.
value An <see cref="T:System.Object" /> that specifies the type of array for which to get properties.
public bool
GetPropertiesSupported​()
Inherited from TypeConverter
Returns whether this object supports properties.
Returns <see langword="true" /> if <see cref="M:System.ComponentModel.TypeConverter.GetProperties(System.Object)" /> should be called to find the properties of this object; otherwise, <see langword="false" /> .
public bool
GetPropertiesSupported​(ITypeDescriptorContext context)
Inherited from TypeConverter
Returns whether this object supports properties, using the specified context.
Returns <see langword="true" /> if <see cref="M:System.ComponentModel.TypeConverter.GetProperties(System.Object)" /> should be called to find the properties of this object; otherwise, <see langword="false" /> .
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
GetStandardValues​()
Inherited from TypeConverter
Returns a collection of standard values from the default context for the data type this type converter is designed for.
Returns A <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection" /> containing a standard set of valid values, or <see langword="null" /> if the data type does not support a standard set of values.
GetStandardValues​(ITypeDescriptorContext context)
Inherited from TypeConverter
Returns a collection of standard values for the data type this type converter is designed for when provided with a format context.
Returns A <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection" /> that holds a standard set of valid values, or <see langword="null" /> if the data type does not support a standard set of values.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> 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 <see langword="null" /> .
public bool
GetStandardValuesExclusive​()
Inherited from TypeConverter
Returns whether the collection of standard values returned from <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues" /> is an exclusive list.
Returns <see langword="true" /> if the <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection" /> returned from <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues" /> is an exhaustive list of possible values; <see langword="false" /> if other values are possible.
public bool
GetStandardValuesExclusive​(ITypeDescriptorContext context)
Inherited from TypeConverter
Returns whether the collection of standard values returned from <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues" /> is an exclusive list of possible values, using the specified context.
Returns <see langword="true" /> if the <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection" /> returned from <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues" /> is an exhaustive list of possible values; <see langword="false" /> if other values are possible.
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
public bool
GetStandardValuesSupported​()
Inherited from TypeConverter
Returns whether this object supports a standard set of values that can be picked from a list.
Returns <see langword="true" /> if <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues" /> should be called to find a common set of values the object supports; otherwise, <see langword="false" /> .
public bool
GetStandardValuesSupported​(ITypeDescriptorContext context)
Inherited from TypeConverter
Returns whether this object supports a standard set of values that can be picked from a list, using the specified context.
Returns <see langword="true" /> if <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues" /> should be called to find a common set of values the object supports; otherwise, <see langword="false" /> .
context An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.
public bool
IsValid​(object value)
Inherited from TypeConverter
Returns whether the given value object is valid for this type.
Returns <see langword="true" /> if the specified value is valid for this object; otherwise, <see langword="false" /> .
value The object to test for validity.
SortProperties​(PropertyDescriptorCollection props, string[] names)
Inherited from TypeConverter
Sorts a collection of properties.
Returns A <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that contains the sorted properties.
props A <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that has the properties to sort.
names An array of names in the order you want the properties to appear in the collection.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object