New to Telerik UI for WPFStart a free 30-day trial

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:

C#
public class DateTimeIntervalConverter : TypeConverter

Inheritance: objectTypeConverterDateTimeIntervalConverter

Inherited Members TypeConverter.CanConvertFrom(Type)TypeConverter.CanConvertTo(Type)TypeConverter.ConvertFrom(object)TypeConverter.ConvertFromInvariantString(string)TypeConverter.ConvertFromInvariantString(ITypeDescriptorContext, string)TypeConverter.ConvertFromString(string)TypeConverter.ConvertFromString(ITypeDescriptorContext, string)TypeConverter.ConvertFromString(ITypeDescriptorContext, CultureInfo, string)TypeConverter.ConvertTo(object, Type)TypeConverter.ConvertToInvariantString(object)TypeConverter.ConvertToInvariantString(ITypeDescriptorContext, object)TypeConverter.ConvertToString(object)TypeConverter.ConvertToString(ITypeDescriptorContext, object)TypeConverter.ConvertToString(ITypeDescriptorContext, CultureInfo, object)TypeConverter.CreateInstance(IDictionary)TypeConverter.CreateInstance(ITypeDescriptorContext, IDictionary)TypeConverter.GetConvertFromException(object)TypeConverter.GetConvertToException(object, Type)TypeConverter.GetCreateInstanceSupported()TypeConverter.GetCreateInstanceSupported(ITypeDescriptorContext)TypeConverter.GetProperties(object)TypeConverter.GetProperties(ITypeDescriptorContext, object)TypeConverter.GetProperties(ITypeDescriptorContext, object, Attribute[])TypeConverter.GetPropertiesSupported()TypeConverter.GetPropertiesSupported(ITypeDescriptorContext)TypeConverter.GetStandardValues()TypeConverter.GetStandardValues(ITypeDescriptorContext)TypeConverter.GetStandardValuesExclusive()TypeConverter.GetStandardValuesExclusive(ITypeDescriptorContext)TypeConverter.GetStandardValuesSupported()TypeConverter.GetStandardValuesSupported(ITypeDescriptorContext)TypeConverter.IsValid(object)TypeConverter.IsValid(ITypeDescriptorContext, object)TypeConverter.SortProperties(PropertyDescriptorCollection, string[])...

Constructors

C#
public DateTimeIntervalConverter()

Methods

Gets a value indicating whether this converter can convert an object in the given source type to a DateTimeInterval using the specified context.

C#
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters:contextITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

sourceTypeType

A Type that represents the type you want to convert from.

Returns:

bool

True if this converter can perform the conversion; otherwise, false.

Overrides: TypeConverter.CanConvertFrom(ITypeDescriptorContext, Type)

Returns whether this converter can convert the object to the specified type, using the specified context.

C#
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Parameters:contextITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

destinationTypeType

A Type that represents the type you want to convert to.

Returns:

bool

True if this converter can perform the conversion; otherwise, false.

Exceptions:

ArgumentNullException

destinationType is null.

FormatException

destinationType is not a valid value for the target type.

Overrides: TypeConverter.CanConvertTo(ITypeDescriptorContext, Type)

Converts the given object to a DateTimeInterval.

C#
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters:contextITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

cultureCultureInfo

An optional CultureInfo. If not supplied, the current culture is assumed.

valueobject

The object to convert.

Returns:

object

An object that represents the converted value.

Exceptions:

NotSupportedException

The conversion cannot be performed.

ArgumentNullException

value is null.

ArgumentOutOfRangeException

value contains negative value.

FormatException

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.

OverflowException

Given values for Days or Months in value are less than 0 and MaxValue.

Overrides: TypeConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, object)

Converts the given object to another type.

C#
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters:contextITypeDescriptorContext

A formatter context.

cultureCultureInfo

The culture into which value will be converted.

valueobject

The object to convert.

destinationTypeType

The type to convert the object to.

Returns:

object

The converted object.

Exceptions:

ArgumentNullException

destinationType is null.

Overrides: TypeConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)