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,如果無法取得物件,則為 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.

傳回

Exception,表示無法執行轉換時將擲回的例外狀況。An Exception that represents the exception to throw when a conversion cannot be performed.

例外狀況

由這個方法自動擲回。Automatically thrown by this method.

適用於