CustomAttributeFormatException 建構函式

定義

初始化 CustomAttributeFormatException 類別的新執行個體。Initializes a new instance of the CustomAttributeFormatException class.

多載

CustomAttributeFormatException()

使用預設屬性,初始化 CustomAttributeFormatException 類別的新執行個體。Initializes a new instance of the CustomAttributeFormatException class with the default properties.

CustomAttributeFormatException(String)

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

CustomAttributeFormatException(SerializationInfo, StreamingContext)

使用指定的序列化及內容資訊,初始化 CustomAttributeFormatException 類別的新執行個體。Initializes a new instance of the CustomAttributeFormatException class with the specified serialization and context information.

CustomAttributeFormatException(String, Exception)

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 CustomAttributeFormatException 類別的新執行個體。Initializes a new instance of the CustomAttributeFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

CustomAttributeFormatException()

使用預設屬性,初始化 CustomAttributeFormatException 類別的新執行個體。Initializes a new instance of the CustomAttributeFormatException class with the default properties.

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

備註

這個函式會 CustomAttributeFormatException 使用空的訊息字串和將根本原因例外狀況設定為來初始化的實例 nullThis constructor initializes an instance of CustomAttributeFormatException with an empty message string and the root cause exception set to null.

這個函式會設定物件的屬性,如下所示 ExceptionThis constructor sets the properties of the Exception object as follows:

屬性Property Value
InnerException nullnull
Message ( "" ) 的空字串。The empty string ("").

適用於

CustomAttributeFormatException(String)

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

public:
 CustomAttributeFormatException(System::String ^ message);
public CustomAttributeFormatException (string? message);
public CustomAttributeFormatException (string message);
new System.Reflection.CustomAttributeFormatException : string -> System.Reflection.CustomAttributeFormatException
Public Sub New (message As String)

參數

message
String

訊息,表示擲回這個例外狀況的原因。The message that indicates the reason this exception was thrown.

備註

這個函式會設定例外狀況物件的屬性,如下所示:This constructor sets the properties of the Exception object as follows:

屬性Property Value
InnerException null

另請參閱

適用於

CustomAttributeFormatException(SerializationInfo, StreamingContext)

使用指定的序列化及內容資訊,初始化 CustomAttributeFormatException 類別的新執行個體。Initializes a new instance of the CustomAttributeFormatException class with the specified serialization and context information.

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

參數

info
SerializationInfo

用於序列化或還原序列化自訂屬性的資料。The data for serializing or deserializing the custom attribute.

context
StreamingContext

自訂屬性的來源和目的端。The source and destination for the custom attribute.

適用於

CustomAttributeFormatException(String, Exception)

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 CustomAttributeFormatException 類別的新執行個體。Initializes a new instance of the CustomAttributeFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 CustomAttributeFormatException(System::String ^ message, Exception ^ inner);
public CustomAttributeFormatException (string? message, Exception? inner);
public CustomAttributeFormatException (string message, Exception inner);
new System.Reflection.CustomAttributeFormatException : string * Exception -> System.Reflection.CustomAttributeFormatException
Public Sub New (message As String, inner As Exception)

參數

message
String

解釋例外狀況原因的錯誤訊息。The error message that explains the reason for the exception.

inner
Exception

做為目前例外狀況發生原因的例外狀況。The exception that is the cause of the current exception. 如果 inner 參數不是 null,則目前的例外狀況會在處理內部例外的 catch 區塊中引發。If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

備註

被擲回以做為前一個例外狀況直接結果的例外狀況,應該在 InnerException 屬性中包含對前一個例外狀況的參考。An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. InnerException 屬性傳回的值會與傳入建構函式的值相同,或傳回 null (如果 InnerException 屬性未提供內部例外狀況值給建構函式)。The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

下表顯示 CustomAttributeFormatException 執行個體的初始屬性值。The following table shows the initial property values for an instance of CustomAttributeFormatException.

屬性Property Value
InnerException inner例外狀況。The inner exception.
Message 錯誤訊息字串。The error message string.

另請參閱

適用於