ClassDateTimeIntervalConverter
Provides a type converter to convert DateTimeInterval objects to and from other representations.
Definition
Namespace:Telerik.Windows.Controls.ScheduleView.Design
Assembly:Telerik.Windows.Controls.ScheduleView.dll
Syntax:
public class DateTimeIntervalConverter : TypeConverter
Inheritance: objectTypeConverterDateTimeIntervalConverter
Inherited Members
Constructors
DateTimeIntervalConverter()
Declaration
public DateTimeIntervalConverter()
Methods
CanConvertFrom(ITypeDescriptorContext, Type)
Gets a value indicating whether this converter can convert an object in the given source type to a DateTimeInterval using the specified context.
Declaration
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters
context
An ITypeDescriptorContext that provides a format context.
sourceType
A Type that represents the type you want to convert from.
Returns
True if this converter can perform the conversion; otherwise, false.
Overrides
CanConvertTo(ITypeDescriptorContext, Type)
Returns whether this converter can convert the object to the specified type, using the specified context.
Declaration
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Parameters
context
An ITypeDescriptorContext that provides a format context.
destinationType
A Type that represents the type you want to convert to.
Returns
True if this converter can perform the conversion; otherwise, false.
Exceptions
destinationType is null.
destinationType is not a valid value for the target type.
Overrides
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Converts the given object to a DateTimeInterval.
Declaration
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
context
An ITypeDescriptorContext that provides a format context.
culture
An optional CultureInfo. If not supplied, the current culture is assumed.
value
The object to convert.
Returns
An object that represents the converted value.
Exceptions
The conversion cannot be performed.
value is null.
value contains negative value.
value is not in the correct format. The string should be in format like
this: "{i}d {i}m" where {i} represents an int number.
Given values for Days or Months in value are less
than 0 and MaxValue.
Overrides
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Converts the given object to another type.
Declaration
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
context
A formatter context.
culture
The culture into which value will be converted.
value
The object to convert.
destinationType
The type to convert the object to.
Returns
The converted object.
Exceptions
destinationType is null.
Overrides