TypeConverter.GetConvertToException(Object, Type) 方法
定义
返回当转换无法执行时所引发的异常。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,或者,如果该对象不可用,则为 null
。The 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.
返回
一个 Exception,表示当无法执行转换时引发的异常。An Exception that represents the exception to throw when a conversion cannot be performed.
例外
由此方法自动引发。Automatically thrown by this method.