CompositionContractMismatchException 建構函式

定義

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

多載

CompositionContractMismatchException()

以系統提供的錯誤說明訊息,初始化 CompositionContractMismatchException 類別的新執行個體。Initializes a new instance of the CompositionContractMismatchException class with a system-supplied message that describes the error.

CompositionContractMismatchException(String)

使用指定的錯誤說明訊息,初始化 CompositionContractMismatchException 類別的新執行個體。Initializes a new instance of the CompositionContractMismatchException class with a specified message that describes the error.

CompositionContractMismatchException(SerializationInfo, StreamingContext)

使用序列化資料,初始化 CompositionContractMismatchException 類別的新執行個體。Initializes a new instance of the CompositionContractMismatchException class with serialized data.

CompositionContractMismatchException(String, Exception)

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

CompositionContractMismatchException()

以系統提供的錯誤說明訊息,初始化 CompositionContractMismatchException 類別的新執行個體。Initializes a new instance of the CompositionContractMismatchException class with a system-supplied message that describes the error.

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

備註

此建構函式會將新執行個體的 Message 屬性初始化為系統提供的錯誤說明訊息,例如 "DefaultMessageDisplayedByParameterlessCtorWriterMustSupply"。This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as "DefaultMessageDisplayedByParameterlessCtorWriterMustSupply". 此訊息會考量目前的系統文化特性。This message takes into account the current system culture.

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

屬性Property Value
InnerException null.null.
Message 當地語系化的錯誤訊息字串。The localized error message string.

另請參閱

CompositionContractMismatchException(String)

使用指定的錯誤說明訊息,初始化 CompositionContractMismatchException 類別的新執行個體。Initializes a new instance of the CompositionContractMismatchException class with a specified message that describes the error.

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

參數

message
String

說明例外狀況的訊息。The message that describes the exception. 這個建構函式的呼叫端必須確保這個字串已經被當地語系化 (為了目前系統的文化特性)。The caller of this constructor is required to ensure that this string has been localized for the current system culture.

備註

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

屬性Property Value
InnerException null.null.
Message message 中指定的錯誤訊息字串。The error message string specified in message.

另請參閱

CompositionContractMismatchException(SerializationInfo, StreamingContext)

使用序列化資料,初始化 CompositionContractMismatchException 類別的新執行個體。Initializes a new instance of the CompositionContractMismatchException class with serialized data.

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

參數

info
SerializationInfo

存放序列物件資料的物件。The object that holds the serialized object data.

context
StreamingContext

關於來源或目的端的內容資訊。The contextual information about the source or destination.

例外狀況

infonullinfo is null.

info 遺漏必要的值。info is missing a required value.

info 包含無法轉換成正確型別的值。info contains a value that cannot be cast to the correct type.

備註

進行還原序列化 (Deserialization) 期間會呼叫這個建構函式,以便重新構成經由資料流傳送的例外狀況物件。This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. 如需詳細資訊,請參閱 < XML 和 SOAP 序列化For more information, see XML and SOAP Serialization.

另請參閱

CompositionContractMismatchException(String, Exception)

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

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

參數

message
String

說明例外狀況的訊息。The message that describes the exception. 這個建構函式的呼叫端必須確保這個字串已經被當地語系化 (為了目前系統的文化特性)。The caller of this constructor is required to ensure that this string has been localized for the current system culture.

innerException
Exception

做為目前例外狀況發生原因的例外狀況。The exception that is the cause of the current exception. 如果 innerException 參數不是 null,則目前的例外狀況會在處理內部例外的 catch 區塊中引發。If the innerException 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 屬性沒有提供內部例外值給建構函式,則傳回 InnerExceptionThe 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.

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

屬性Property Value
InnerException null.null.
Message message 中指定的錯誤訊息字串。The error message string specified in message.

另請參閱

適用於