Skip to content

M_Cyjb_GenericConvert_AddConverter__2

CYJB edited this page Mar 20, 2024 · 13 revisions

GenericConvert.AddConverter(TInput, TOutput) 方法

添加将对象从 TInput 类型转换为 TOutput 类型的转换器。

Namespace: Cyjb
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

public static void AddConverter<TInput, TOutput>(
	Converter<TInput, TOutput> converter
)

参数

 

converter
Type: System.Converter(TInput, TOutput)
将对象从 TInput 类型转换为 TOutput 类型的转换器。

类型参数

 

TInput
输入对象的类型。
TOutput
输出对象的类型。

Exceptions

 

异常 条件
ArgumentNullException converternull

Remarks

converter 不会覆盖预定义的隐式、显式类型转换和用户自定义的类型转换。 对于相同输入/输出类型的 converter,后设置的会覆盖先设置的,以及任何 IConverterProvider 提供的类型转换方法。

参见

Reference

GenericConvert 类
Cyjb 命名空间

Clone this wiki locally