M_Cyjb_GenericConvert_AddConverter__2 - CYJB/Cyjb GitHub Wiki
添加将对象从 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
- 输出对象的类型。
异常 | 条件 |
---|---|
ArgumentNullException |
converter 为 null 。 |
converter 不会覆盖预定义的隐式、显式类型转换和用户自定义的类型转换。 对于相同输入/输出类型的 converter,后设置的会覆盖先设置的,以及任何 IConverterProvider 提供的类型转换方法。