TypeConverter.GetConvertToException(Object, Type) Method

Definition

返回当转换无法执行时所引发的异常。Returns an exception to throw when a conversion cannot be performed.

protected:
 Exception ^ GetConvertToException(System::Object ^ value, Type ^ destinationType);
protected Exception GetConvertToException (object value, Type destinationType);
member this.GetConvertToException : obj * Type -> Exception
Protected Function GetConvertToException (value As Object, destinationType As Type) As Exception

Parameters

value
Object

要转换的 Object,或者,如果该对象不可用,则为 nullThe Object to convert, or null if the object is not available.

destinationType
Type

一个 Type,表示转换尝试转换到的类型。A Type that represents the type the conversion was trying to convert to.

Returns

Exception

一个 Exception,表示当无法执行转换时引发的异常。An Exception that represents the exception to throw when a conversion cannot be performed.

Exceptions

由此方法自动引发。Automatically thrown by this method.

Applies to