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

Provides methods for converting text decoration settings to and from UI representations.

Definition

Namespace:Telerik.Windows.Documents.UI.TextDecorations.DecorationProviders

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public class DecorationUIConverter : TypeConverter

Inheritance: objectTypeConverterDecorationUIConverter

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 DecorationUIConverter()

Methods

Determines whether the provided source type can be converted from the specified type.

C#
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
Parameters:typeDescriptorContextITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

sourceTypeType

The type to check for conversion.

Returns:

bool

Returns true if the source type can be converted; otherwise, false.

Overrides: TypeConverter.CanConvertFrom(ITypeDescriptorContext, Type)

Determines whether the conversion from a specified source type to a target type is supported.

C#
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
Parameters:typeDescriptorContextITypeDescriptorContext

An instance of ITypeDescriptorContext that provides a format context.

destinationTypeType

The Type that represents the type to convert to.

Returns:

bool

True if the conversion is supported; otherwise, false.

Overrides: TypeConverter.CanConvertTo(ITypeDescriptorContext, Type)

Converts the specified object to a text decoration representation based on the provided context and culture information.

C#
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object source)
Parameters:typeDescriptorContextITypeDescriptorContext

The context in which the conversion is being performed, providing information about the environment.

cultureInfoCultureInfo

The culture information used for the conversion process.

sourceobject

The object to be converted to a text decoration representation.

Returns:

object

A value of type T that represents the converted text decoration.

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

Converts the specified value to a specified type using the provided context and culture information.

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

An object that provides a format context for the conversion.

cultureCultureInfo

A CultureInfo object that specifies the culture to be used for the conversion.

valueobject

The value to convert.

destinationTypeType

The Type to which the value should be converted.

Returns:

object

The converted value of the specified type. If the conversion fails, it may return null or throw an exception, depending on the implementation.

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