TypeConverter.GetConvertToException(Object, Type) TypeConverter.GetConvertToException(Object, Type) TypeConverter.GetConvertToException(Object, Type) TypeConverter.GetConvertToException(Object, Type) Method

定义

返回无法执行转换时引发的异常。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

参数

value
Object Object Object Object

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

destinationType
Type Type Type Type

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

返回

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

异常

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

适用于