LengthConverter
Converts numeric values and length strings to lengths in the editor's 96-DPI coordinate system, and formats lengths for designer serialization.
Definition
Namespace:Telerik.WinControls.RichTextEditor.UI
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class LengthConverter : TypeConverter
Inheritance: objectTypeConverterLengthConverter
Inherited Members
Constructors
Creates a converter that parses lengths in 96-DPI units, including Auto and the px, in, cm, and pt suffixes.
public LengthConverter()
Methods
Determines whether the specified source type is supported.
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
The conversion context, which this converter does not use.
sourceTypeTypeThe source type to test.
Returns:true for supported numeric types and strings; otherwise, false.
Overrides:
Determines whether the specified destination type is supported for length serialization.
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
The conversion context, which this converter does not use.
destinationTypeTypeThe destination type to test.
Returns:true for string and InstanceDescriptor; otherwise, false.
Overrides:
Converts a numeric value or a unit-bearing string to a length in 96-DPI units.
The string value Auto is represented by NaN.
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object source)
The conversion context, which this converter does not use.
cultureInfoCultureInfoThe culture used to parse the value.
sourceobjectA numeric value or a string with an optional px, in, cm, or pt suffix.
The converted length.
Overrides:
Converts a numeric length to a culture-formatted string or a designer serialization descriptor.
A NaN value is emitted as Auto when converting to a string.
public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType)
The conversion context, which this converter does not use.
cultureInfoCultureInfoThe culture used to format a string result.
valueobjectThe length value to convert; it must be a double.
destinationTypeTypeThe requested destination type.
Returns:A string or InstanceDescriptor describing the length.
Exceptions: ArgumentNullExceptiondestinationType is null.
Overrides: