FontUnitConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) 方法

定义

FontUnit 转换为具有不同数据类型的对象。Converts a FontUnit to an object with a different data type.

public:
 override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value, Type ^ destinationType);
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType);
override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj
Public Overrides Function ConvertTo (context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object

参数

context
ITypeDescriptorContext

一个实现了 ITypeDescriptorContext 的对象,它提供有关类型转换器上下文的信息。An ITypeDescriptorContext implemented object that provides information about the context of a type converter.

culture
CultureInfo

指定用于表示 CultureInfo(当它以磅表示时)的区域性的 FontUnitA CultureInfo that specifies the culture to represent the FontUnit, when it is expressed in points.

value
Object

表示要转换的 ObjectFontUnitA Object that represents the FontUnit to convert.

destinationType
Type

表示要转换为的数据类型的 TypeA Type that represents the data type to convert to.

返回

Object

Object,表示已转换的值。A Object that represents the converted value.

注解

使用方法可value将参数指定FontUnit的转换为具有destinationType参数指定的数据类型的对象。 ConvertToUse the ConvertTo method to convert the FontUnit specified by the value parameter to an object with the data type specified by the destinationType parameter.

备注

String.Empty如果value参数包含null, 则从此方法返回。String.Empty is returned from this method if the value parameter contains null. String.Empty如果TypeFontUnit 参数指定FontSize.NotSet的的属性包含值, 也将返回。 valueString.Empty is also returned if the Type property of the FontUnit specified by the value parameter contains the value FontSize.NotSet.

备注

此方法只能将转换FontUnit为字符串。This method can only convert a FontUnit to a string.

适用于

另请参阅