InvalidEnumArgumentException InvalidEnumArgumentException InvalidEnumArgumentException InvalidEnumArgumentException Constructors

定義

多載

InvalidEnumArgumentException() InvalidEnumArgumentException() InvalidEnumArgumentException()

不使用訊息來初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class without a message.

InvalidEnumArgumentException(String) InvalidEnumArgumentException(String) InvalidEnumArgumentException(String) InvalidEnumArgumentException(String)

使用指定的訊息初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class with the specified message.

InvalidEnumArgumentException(SerializationInfo, StreamingContext) InvalidEnumArgumentException(SerializationInfo, StreamingContext) InvalidEnumArgumentException(SerializationInfo, StreamingContext) InvalidEnumArgumentException(SerializationInfo, StreamingContext)

使用指定的序列化資料和內容,初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class using the specified serialization data and context.

InvalidEnumArgumentException(String, Exception) InvalidEnumArgumentException(String, Exception) InvalidEnumArgumentException(String, Exception) InvalidEnumArgumentException(String, Exception)

使用指定的詳細描述和指定的例外狀況,初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class with the specified detailed description and the specified exception.

InvalidEnumArgumentException(String, Int32, Type) InvalidEnumArgumentException(String, Int32, Type) InvalidEnumArgumentException(String, Int32, Type) InvalidEnumArgumentException(String, Int32, Type)

使用引數、無效值和列舉型別 (Enumeration) 類別所產生的訊息來初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class with a message generated from the argument, the invalid value, and an enumeration class.

InvalidEnumArgumentException() InvalidEnumArgumentException() InvalidEnumArgumentException()

不使用訊息來初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class without a message.

public:
 InvalidEnumArgumentException();
public InvalidEnumArgumentException ();
Public Sub New ()

InvalidEnumArgumentException(String) InvalidEnumArgumentException(String) InvalidEnumArgumentException(String) InvalidEnumArgumentException(String)

使用指定的訊息初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class with the specified message.

public:
 InvalidEnumArgumentException(System::String ^ message);
public InvalidEnumArgumentException (string message);
new System.ComponentModel.InvalidEnumArgumentException : string -> System.ComponentModel.InvalidEnumArgumentException
Public Sub New (message As String)

參數

message
String String String String

與這個例外狀況一起顯示的訊息。The message to display with this exception.

InvalidEnumArgumentException(SerializationInfo, StreamingContext) InvalidEnumArgumentException(SerializationInfo, StreamingContext) InvalidEnumArgumentException(SerializationInfo, StreamingContext) InvalidEnumArgumentException(SerializationInfo, StreamingContext)

使用指定的序列化資料和內容,初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class using the specified serialization data and context.

protected:
 InvalidEnumArgumentException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected InvalidEnumArgumentException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.ComponentModel.InvalidEnumArgumentException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.ComponentModel.InvalidEnumArgumentException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

要用於還原序列化 (Deserialization) 的 SerializationInfoThe SerializationInfo to be used for deserialization.

context
StreamingContext StreamingContext StreamingContext StreamingContext

要用於還原序列化的目的端。The destination to be used for deserialization.

InvalidEnumArgumentException(String, Exception) InvalidEnumArgumentException(String, Exception) InvalidEnumArgumentException(String, Exception) InvalidEnumArgumentException(String, Exception)

使用指定的詳細描述和指定的例外狀況,初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class with the specified detailed description and the specified exception.

public:
 InvalidEnumArgumentException(System::String ^ message, Exception ^ innerException);
public InvalidEnumArgumentException (string message, Exception innerException);
new System.ComponentModel.InvalidEnumArgumentException : string * Exception -> System.ComponentModel.InvalidEnumArgumentException
Public Sub New (message As String, innerException As Exception)

參數

message
String String String String

錯誤的詳細描述。A detailed description of the error.

innerException
Exception Exception Exception Exception

造成這個例外狀況之內部例外狀況的參考。A reference to the inner exception that is the cause of this exception.

InvalidEnumArgumentException(String, Int32, Type) InvalidEnumArgumentException(String, Int32, Type) InvalidEnumArgumentException(String, Int32, Type) InvalidEnumArgumentException(String, Int32, Type)

使用引數、無效值和列舉型別 (Enumeration) 類別所產生的訊息來初始化 InvalidEnumArgumentException 類別的新執行個體。Initializes a new instance of the InvalidEnumArgumentException class with a message generated from the argument, the invalid value, and an enumeration class.

public:
 InvalidEnumArgumentException(System::String ^ argumentName, int invalidValue, Type ^ enumClass);
public InvalidEnumArgumentException (string argumentName, int invalidValue, Type enumClass);
new System.ComponentModel.InvalidEnumArgumentException : string * int * Type -> System.ComponentModel.InvalidEnumArgumentException
Public Sub New (argumentName As String, invalidValue As Integer, enumClass As Type)

參數

argumentName
String String String String

造成例外狀況的引數名稱。The name of the argument that caused the exception.

invalidValue
Int32 Int32 Int32 Int32

失敗的引數值。The value of the argument that failed.

enumClass
Type Type Type Type

Type,表示具有有效值的列舉型別類別。A Type that represents the enumeration class with the valid values.

備註

此函式會建立當地語系化的訊息, 指出argumentName參數無效, 因為傳入的值無效, 而且該值應該是列舉類別中的其中一個值。This constructor will create a localized message saying that the argumentName parameter was invalid because the value passed in was invalid, and that the value should be one of the values in the enumeration class.

適用於