语言

FormatterConverter.Convert 方法

定义

将值转换为给定类型。

重载

名称 说明
Convert(Object, Type)

将值转换为给定 Type值。

Convert(Object, TypeCode)

将值转换为给定 TypeCode值。

Convert(Object, Type)

Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs

将值转换为给定 Type值。

public:
 virtual System::Object ^ Convert(System::Object ^ value, Type ^ type);
public object Convert(object value, Type type);
abstract member Convert : obj * Type -> obj
override this.Convert : obj * Type -> obj
Public Function Convert (value As Object, type As Type) As Object

参数

value
Object

要转换的对象。

type
Type

Type转换到其中的项value。

返回

已 value 转换或 null 参数是否 type 为 null。

实现

例外

参数 value 为 null.

适用于

Convert(Object, TypeCode)

Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs
Source:
FormatterConverter.cs

将值转换为给定 TypeCode值。

public:
 virtual System::Object ^ Convert(System::Object ^ value, TypeCode typeCode);
public object Convert(object value, TypeCode typeCode);
abstract member Convert : obj * TypeCode -> obj
override this.Convert : obj * TypeCode -> obj
Public Function Convert (value As Object, typeCode As TypeCode) As Object

参数

value
Object

要转换的对象。

typeCode
TypeCode

TypeCode转换到其中的项value。

返回

已 value转换,或者 null 参数 type 为 null。

实现

例外

参数 value 为 null.

适用于