Point3DConverter
Converts Point3D values to and from culture-aware, list-separator-delimited X, Y, and Z strings, and supports component-model property editing.
Definition
Namespace:Telerik.WinControls.UI.Carousel
Assembly:Telerik.WinControls.UI.dll
Syntax:
public sealed class Point3DConverter : TypeConverter
Inheritance: objectTypeConverterPoint3DConverter
Inherited Members
Constructors
public Point3DConverter()
Methods
Determines whether this converter accepts strings in addition to the types supported by TypeConverter.
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
A descriptor context that may provide additional conversion information.
sourceTypeTypeThe type to convert from.
Returns:true for strings or when the base converter supports the source type.
Overrides:
Determines whether this converter can produce an instance descriptor in addition to the types supported by TypeConverter.
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
A descriptor context that may provide additional conversion information.
destinationTypeTypeThe destination type.
Returns:true for InstanceDescriptor or when the base converter supports the destination type.
Overrides:
Parses a culture-aware, list-separator-delimited string containing exactly three coordinates, or delegates other inputs to the base converter.
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
A descriptor context that may provide additional conversion information.
cultureCultureInfoThe culture used to parse the coordinates; the current culture is used when this is null.
valueobjectThe string to parse, or a value handled by the base converter.
Returns:A Point3D for a valid coordinate string, null for an empty string, or the base converter's result for other inputs.
Exceptions: ArgumentExceptionThe string does not contain exactly three coordinates.
Overrides:
Converts a Point3D to a culture-aware coordinate string or an instance descriptor, and delegates other conversions to the base converter.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
A descriptor context that may provide additional conversion information.
cultureCultureInfoThe culture used to format the coordinates; the current culture is used when this is null.
valueobjectThe value to convert.
destinationTypeTypeThe requested destination type.
Returns:The converted value, or the base converter's result for unsupported conversion cases.
Exceptions: ArgumentNullExceptiondestinationType is null.
Overrides:
Creates a Point3D from component property values named X, Y, and optionally Z.
public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues)
A descriptor context that may provide additional creation information.
propertyValuesIDictionaryThe coordinate values; X and Y must be double values, while a missing or non-double Z defaults to zero.
Returns:A point initialized from the supplied coordinate values.
Exceptions: ArgumentNullExceptionpropertyValues is null.
X or Y is missing or is not a double value.
Overrides:
Indicates that the converter can create a point from its component properties.
public override bool GetCreateInstanceSupported(ITypeDescriptorContext context)
A descriptor context that may provide additional information.
Returns:Always true.
Overrides:
Gets the X, Y, and Z property descriptors in that order.
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
A descriptor context that may provide additional property information.
valueobjectThe object whose properties are requested.
attributesAttribute[]Attributes used to filter the returned properties.
Returns:The Point3D property descriptors sorted as X, Y, Z.
Overrides:
Indicates that the converter exposes the point's component properties.
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
A descriptor context that may provide additional information.
Returns:Always true.
Overrides: