Class
DateTimeIntervalConverter

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:

cs-api-definition
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

DateTimeIntervalConverter()

Declaration

cs-api-definition
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

cs-api-definition
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)

Parameters

context

ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

sourceType

Type

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)

CanConvertTo(ITypeDescriptorContext, Type)

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

Declaration

cs-api-definition
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)

Parameters

context

ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

destinationType

Type

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)

ConvertFrom(ITypeDescriptorContext, CultureInfo, object)

Converts the given object to a DateTimeInterval.

Declaration

cs-api-definition
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)

Parameters

context

ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

culture

CultureInfo

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

value

object

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)

ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)

Converts the given object to another type.

Declaration

cs-api-definition
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)

Parameters

context

ITypeDescriptorContext

A formatter context.

culture

CultureInfo

The culture into which value will be converted.

value

object

The object to convert.

destinationType

Type

The type to convert the object to.

Returns

object

The converted object.

Exceptions

ArgumentNullException

destinationType is null.

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