LengthConverter
Converts numeric and textual lengths used by ItemWidth and
ItemHeight. Text can use pixel, inch, centimeter, or point suffixes;
Auto represents an unspecified length.
Definition
Namespace:Telerik.WinControls.Layout
Assembly:Telerik.WinControls.dll
Syntax:
public class LengthConverter : TypeConverter
Inheritance: objectTypeConverterLengthConverter
Inherited Members
Constructors
public LengthConverter()
Methods
Determines whether the converter accepts a supported numeric type or a string.
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
The context for the conversion.
sourceTypeTypeThe type to convert from.
Returns:true for supported numeric types and strings; otherwise, false.
Overrides:
Determines whether the converter can produce a string or an instance descriptor.
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
The context for the conversion.
destinationTypeTypeThe type to convert to.
Returns:true for string or InstanceDescriptor; otherwise, false.
Overrides:
Converts a numeric or textual length to a value accepted by the wrap panel's item-size properties.
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object source)
The context for the conversion.
cultureInfoCultureInfoThe culture used to interpret numeric text.
sourceobjectA supported numeric value or a length string; Auto is parsed as NaN.
A converted numeric length.
Overrides:
Converts a floating-point length to a string or to a designer-serialization descriptor.
[SecurityCritical]
public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType)
The context for the conversion.
cultureInfoCultureInfoThe culture used to format the numeric value.
valueobjectA floating-point length to convert.
destinationTypeTypeThe target representation: string or InstanceDescriptor.
NaN is represented as Auto when converted to a string.
The requested string or instance descriptor.
Exceptions: ArgumentNullExceptiondestinationType is null.
Overrides: