LengthConverter
Definition
Namespace:Telerik.WinControls.UI.Diagrams
Assembly:Telerik.WinControls.RadDiagram.dll
Syntax:
public class LengthConverter : TypeConverter
Inheritance: objectTypeConverterLengthConverter
Inherited Members
Constructors
Creates a converter for numeric and unit-suffixed length values.
public LengthConverter()
Methods
Checks whether the converter accepts one of its supported numeric types or a length string.
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
The conversion context, when available.
sourceTypeTypeThe type of the value to convert.
Returns:true for signed or unsigned 16-, 32-, and 64-bit integers, enums with those underlying types, single- or double-precision values, decimal values, and strings; otherwise, false.
Overrides:
Checks whether a length can be represented as a string or an instance descriptor.
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
The conversion context, when available.
destinationTypeTypeThe requested output type.
Returns:true for string and InstanceDescriptor; otherwise, false.
Overrides:
Converts a numeric value to a double or parses a unit-suffixed length string into pixel units.
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object source)
The conversion context, when available.
cultureInfoCultureInfoThe culture used to parse numeric text.
sourceobjectA supported numeric value or length string. The string Auto produces NaN.
The length in pixel units, with NaN representing Auto.
Overrides:
Converts a double length to a string or an instance descriptor. NaN is represented by the string Auto.
public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType)
The conversion context, when available.
cultureInfoCultureInfoThe culture used when formatting a string.
valueobjectThe length value to convert.
destinationTypeTypeEither string or InstanceDescriptor.
Returns:The formatted length or an instance descriptor that reconstructs the value.
Exceptions: ArgumentNullExceptiondestinationType is null.
Overrides: