ValueSerializer.GetConvertFromException(Object) 方法

定义

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

protected:
 Exception ^ GetConvertFromException(System::Object ^ value);
protected Exception GetConvertFromException (object value);
member this.GetConvertFromException : obj -> Exception
Protected Function GetConvertFromException (value As Object) As Exception

参数

value
Object

无法转换的对象。The object that could not be converted.

返回

Exception

ConvertFrom 转换无法执行时引发异常的 Exception 对象。An Exception object for the exception to throw when a ConvertFrom conversion cannot be performed.

注解

throw此方法不会调用实际关键字,因此典型用法 throw GetConvertFromException 与) 提供的参数 (。The actual throw keyword is not invoked by this method, therefore the typical usage is throw GetConvertFromException (with parameters provided).

返回的特定异常为 InvalidOperationException ,并 value 传入异常消息。The specific exception returned is InvalidOperationException, with value passed in the exception message. 用法的模式与中的异常实用工具的模式相同 TypeConverterThe pattern for usage is the same as for exception utilities in TypeConverter.

适用于