CustomAttributeFormatException 建構函式

定義

初始化 CustomAttributeFormatException 類別的新執行個體。

多載

名稱 Description
CustomAttributeFormatException()

初始化一個帶有預設屬性的新 CustomAttributeFormatException 類別實例。

CustomAttributeFormatException(String)

初始化一個新的類別實例 CustomAttributeFormatException ,並以指定訊息進行。

CustomAttributeFormatException(SerializationInfo, StreamingContext)
已淘汰.

初始化類別的新實例 CustomAttributeFormatException ,並依指定的序列化與上下文資訊。

CustomAttributeFormatException(String, Exception)

初始化類別的新實例 CustomAttributeFormatException ,並附上指定的錯誤訊息及導致該異常的內部例外的參考。

CustomAttributeFormatException()

來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs

初始化一個帶有預設屬性的新 CustomAttributeFormatException 類別實例。

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

備註

此建構子初始化一個實例 CustomAttributeFormatException ,包含空訊息字串及根因例外設為 null

此建構器設定物件的 Exception 性質如下:

房產 價值
InnerException null
Message 空字串(“”)。

適用於

CustomAttributeFormatException(String)

來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs

初始化一個新的類別實例 CustomAttributeFormatException ,並以指定訊息進行。

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

那則訊息說明了這個例外被拋出的原因。

備註

此建構器將 Exception 物件的屬性設定如下:

房產 價值
InnerException null

另請參閱

適用於

CustomAttributeFormatException(SerializationInfo, StreamingContext)

來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs

警告

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

初始化類別的新實例 CustomAttributeFormatException ,並依指定的序列化與上下文資訊。

protected:
 CustomAttributeFormatException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected CustomAttributeFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected CustomAttributeFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Reflection.CustomAttributeFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Reflection.CustomAttributeFormatException
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

用於序列化或反序列化自訂屬性的資料。

context
StreamingContext

自訂屬性的來源與目的地。

屬性

適用於

CustomAttributeFormatException(String, Exception)

來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs
來源:
CustomAttributeFormatException.cs

初始化類別的新實例 CustomAttributeFormatException ,並附上指定的錯誤訊息及導致該異常的內部例外的參考。

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

錯誤訊息解釋了例外原因。

inner
Exception

該例外即為當前例外的原因。 若 inner 參數不 null為 ,則在處理內部異常的區塊中提出 catch 當前例外。

備註

因先前例外直接拋出的例外,應包含對該屬性中 InnerException 先前例外的參考。 該 InnerException 屬性回傳與傳入建構子相同的值,或 null 若該 InnerException 性質未提供內部例外值給建構子。

下表顯示了 的 CustomAttributeFormatException初始屬性值。

房產 價值
InnerException 例外 inner
Message 錯誤訊息字串。

另請參閱

適用於