Class LengthConverter
Converts instances of other types to and from instances of a double that
represent an object measurement such as a height or width.
Inheritance
System.Object
System.ComponentModel.TypeConverter
LengthConverter
Inherited Members
System.ComponentModel.TypeConverter.CanConvertFrom(System.Type)
System.ComponentModel.TypeConverter.CanConvertTo(System.Type)
System.ComponentModel.TypeConverter.ConvertFrom(System.Object)
System.ComponentModel.TypeConverter.ConvertFromInvariantString(System.ComponentModel.ITypeDescriptorContext, System.String)
System.ComponentModel.TypeConverter.ConvertFromInvariantString(System.String)
System.ComponentModel.TypeConverter.ConvertFromString(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.String)
System.ComponentModel.TypeConverter.ConvertFromString(System.ComponentModel.ITypeDescriptorContext, System.String)
System.ComponentModel.TypeConverter.ConvertFromString(System.String)
System.ComponentModel.TypeConverter.ConvertTo(System.Object, System.Type)
System.ComponentModel.TypeConverter.ConvertToInvariantString(System.ComponentModel.ITypeDescriptorContext, System.Object)
System.ComponentModel.TypeConverter.ConvertToInvariantString(System.Object)
System.ComponentModel.TypeConverter.ConvertToString(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)
System.ComponentModel.TypeConverter.ConvertToString(System.ComponentModel.ITypeDescriptorContext, System.Object)
System.ComponentModel.TypeConverter.ConvertToString(System.Object)
System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary)
System.ComponentModel.TypeConverter.CreateInstance(System.ComponentModel.ITypeDescriptorContext, System.Collections.IDictionary)
System.ComponentModel.TypeConverter.GetConvertFromException(System.Object)
System.ComponentModel.TypeConverter.GetConvertToException(System.Object, System.Type)
System.ComponentModel.TypeConverter.GetCreateInstanceSupported()
System.ComponentModel.TypeConverter.GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext)
System.ComponentModel.TypeConverter.GetProperties(System.ComponentModel.ITypeDescriptorContext, System.Object)
System.ComponentModel.TypeConverter.GetProperties(System.ComponentModel.ITypeDescriptorContext, System.Object, System.Attribute[])
System.ComponentModel.TypeConverter.GetProperties(System.Object)
System.ComponentModel.TypeConverter.GetPropertiesSupported()
System.ComponentModel.TypeConverter.GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext)
System.ComponentModel.TypeConverter.GetStandardValues()
System.ComponentModel.TypeConverter.GetStandardValues(System.ComponentModel.ITypeDescriptorContext)
System.ComponentModel.TypeConverter.GetStandardValuesExclusive()
System.ComponentModel.TypeConverter.GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext)
System.ComponentModel.TypeConverter.GetStandardValuesSupported()
System.ComponentModel.TypeConverter.GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext)
System.ComponentModel.TypeConverter.IsValid(System.ComponentModel.ITypeDescriptorContext, System.Object)
System.ComponentModel.TypeConverter.IsValid(System.Object)
System.ComponentModel.TypeConverter.SortProperties(System.ComponentModel.PropertyDescriptorCollection, System.String[])
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: OpenSilver.dll
Syntax
public class LengthConverter : TypeConverter
Constructors
|
Improve this Doc
View Source
LengthConverter()
Declaration
Methods
|
Improve this Doc
View Source
CanConvertFrom(ITypeDescriptorContext, Type)
Determines whether conversion is possible from a specified type to a
System.Double that represents an object
measurement.
Declaration
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
Parameters
| Type |
Name |
Description |
| System.ComponentModel.ITypeDescriptorContext |
typeDescriptorContext |
An System.ComponentModel.ITypeDescriptorContext
that provides a format context.
|
| System.Type |
sourceType |
A System.Type that represents the type you want to
convert from.
|
Returns
| Type |
Description |
| System.Boolean |
True if this converter can perform the conversion; otherwise, false.
|
Overrides
System.ComponentModel.TypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Type)
|
Improve this Doc
View Source
CanConvertTo(ITypeDescriptorContext, Type)
Returns whether the type converter can convert a measurement to the
specified type.
Declaration
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
Parameters
| Type |
Name |
Description |
| System.ComponentModel.ITypeDescriptorContext |
typeDescriptorContext |
An System.ComponentModel.ITypeDescriptorContext
that provides a format context.
|
| System.Type |
destinationType |
A System.Type that represents the type you want to
convert to.
|
Returns
| Type |
Description |
| System.Boolean |
True if this converter can perform the conversion; otherwise, false.
|
Overrides
System.ComponentModel.TypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Type)
|
Improve this Doc
View Source
ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)
Converts from the specified value to values of the
System.Double type.
Declaration
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object source)
Parameters
| Type |
Name |
Description |
| System.ComponentModel.ITypeDescriptorContext |
typeDescriptorContext |
An System.ComponentModel.ITypeDescriptorContext
that provides a format context.
|
| System.Globalization.CultureInfo |
cultureInfo |
The System.Globalization.CultureInfo to use as the
current culture.
|
| System.Object |
source |
The value to convert.
|
Returns
| Type |
Description |
| System.Object |
The converted value.
|
Overrides
System.ComponentModel.TypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)
|
Improve this Doc
View Source
ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)
Converts the specified measurement to the specified type.
Declaration
public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType)
Parameters
| Type |
Name |
Description |
| System.ComponentModel.ITypeDescriptorContext |
typeDescriptorContext |
An object that provides a format context.
|
| System.Globalization.CultureInfo |
cultureInfo |
The System.Globalization.CultureInfo to use as the
current culture.
|
| System.Object |
value |
The value to convert.
|
| System.Type |
destinationType |
A System.Type that represents the type you want to
convert to.
|
Returns
| Type |
Description |
| System.Object |
The converted value.
|
Overrides
System.ComponentModel.TypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object, System.Type)