語言

XamlInternalException 類別

定義

例外是因為 XAML 讀取與寫入過程中發生的內部不一致而拋出。

public ref class XamlInternalException : System::Xaml::XamlException
[System.Serializable]
public class XamlInternalException : System.Xaml.XamlException
public class XamlInternalException : System.Xaml.XamlException
[<System.Serializable>]
type XamlInternalException = class
    inherit XamlException
type XamlInternalException = class
    inherit XamlException
Public Class XamlInternalException
Inherits XamlException
繼承
XamlInternalException
屬性

備註

此例外通常僅在 XAML 讀取器或 XAML 寫入系統的某些部分被你的程式碼擴充,且發生不一致或實作問題,這些問題被傳入 .NET Framework XAML Services 系統程式碼時才會觸發。 來自第三方的例外,例如解析 XAML 並遇到錯誤,不應拋出 XamlInternalException,而是應拋出其他例外,如 XamlParseException 或 XamlObjectWriterException。

如果你正在撰寫.NET擴充 Framework XAML 服務的程式碼,特別是為 XAML 閱讀器或 XAML 寫入器實作撰寫程式碼,你應該保持 XamlInternalException 與其他 XAML 相關例外之間的區分。 你的程式碼應該只在類別進一步擴充違反可呼叫程式碼定義的設計原則或實作模式時才會丟出 XamlInternalException 。 你的程式碼應該會針對例外情況拋出其他 XAML 專屬例外,例如你的 XAML 閱讀器或 XAML 編譯器實作沒有擴充功能,並且用來載入第三方 XAML、第三方 XAML 架構上下文等。

建構函式

名稱 Description
XamlInternalException()

初始化該類別的新實例 XamlInternalException ,並以系統提供的訊息描述錯誤。

XamlInternalException(SerializationInfo, StreamingContext)

初始化一個新的類別實例 XamlInternalException ,並使用序列化資料。

XamlInternalException(String, Exception)

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

XamlInternalException(String)

初始化類別的新實例 XamlInternalException ,並以指定訊息描述錯誤。

屬性

名稱 Description
Data

取得一組鍵值對,提供關於例外的額外使用者定義資訊。

(繼承來源 Exception)
HelpLink

取得或設定與此例外相關的說明檔案連結。

(繼承來源 Exception)
HResult

取得或設定 HRESULT,一個編碼的數值,指派給特定例外。

(繼承來源 Exception)
InnerException

會取得 Exception 造成目前例外的實例。

(繼承來源 Exception)
LineNumber

取得或設定例外報告的 XAML 文字行資訊的行號元件。

(繼承來源 XamlException)
LinePosition

取得或設定例外報告的 XAML 文字行資訊的行位置元件。

(繼承來源 XamlException)
Message

接收或設定例外訊息,若有行資訊,則將該行資訊附加於訊息後。

(繼承來源 XamlException)
Source

取得或設定造成錯誤之應用程式或物件的名稱。

(繼承來源 Exception)
StackTrace

會取得呼叫堆疊上即時框架的字串表示。

(繼承來源 Exception)
TargetSite

會取得拋出當前例外的方法。

(繼承來源 Exception)

方法

名稱 Description
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetBaseException()

當在派生類別中被覆寫時,回傳 Exception 是一個或多個後續例外的根因。

(繼承來源 Exception)
GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetObjectData(SerializationInfo, StreamingContext)

實作 GetObjectData(SerializationInfo, StreamingContext) 並提供線路資訊資料的序列化支援。

(繼承來源 XamlException)
GetType()

取得目前實例的執行時型態。

(繼承來源 Exception)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

建立並回傳當前例外的字串表示。

(繼承來源 Exception)

事件

名稱 Description
SerializeObjectState
已淘汰.

當例外被序列化以建立包含該例外序列化資料的例外狀態物件時,會發生這種情況。

(繼承來源 Exception)

適用於

另請參閱