XamlWriter 類別

定義

提供 XAML 寫入器的預設實作和基底類別定義。Provides default implementation and base class definitions for a XAML writer. 這不是可直接使用的預設 XAML 寫入器;您必須衍生自 XamlWriter 並實作其抽象成員,或使用現有 XamlWriter 衍生類別。This is not a working default XAML writer; you must either derive from XamlWriter and implement its abstract members, or use an existing XamlWriter derived class.

public ref class XamlWriter abstract : IDisposable
public abstract class XamlWriter : IDisposable
type XamlWriter = class
    interface IDisposable
Public MustInherit Class XamlWriter
Implements IDisposable
繼承
XamlWriter
衍生
實作

備註

這兩個最相關的實用衍生XamlWriter類別XamlXmlWriter是和XamlObjectWriter類別, 如下列詳細資料所示:The two most relevant practical derived classes of XamlWriter are the XamlXmlWriter and XamlObjectWriter classes, as the following details explain:

  • XamlXmlWriter處理 XAML 節點集, 並產生 XML 文字檔。XamlXmlWriter processes a XAML node set and produces an XML text file. 此類別可用於序列化, 或做為工具的一部分使用, 其適用于 XAML 的記憶體內標記法, 並產生 XAML 檔案輸出。This class might be used for serialization or as part of the function of a tool that works with in-memory representation of XAML and produces XAML file output.

  • XamlObjectWriter處理 XAML 節點集, 並產生物件圖形。XamlObjectWriter processes a XAML node set and produces an object graph. 此類別可做為技術之 XAML 剖析器的完整或部分自訂的一部分。This class might be used as part of a full or partial customization of a technology's XAML parser.

XamlWriterSettings是所使用XamlWriter之設定的類別; 不過, 根據預設XamlWriterSettings , 類別不會保存任何特定的設定。XamlWriterSettings is a class for settings that are used by a XamlWriter; however, by default, the XamlWriterSettings class does not hold any specific settings. 基底函數不會使用此設定類別做為引數, 也不會XamlWriter執行任何其他成員。 XamlWriterThe XamlWriter base constructor does not use this settings class as an argument, nor does any other XamlWriter member. 相反XamlXmlWriter地, 和XamlObjectWriter類別包含自己的設定類別做為結構引數。Instead, the XamlXmlWriter and XamlObjectWriter classes include their own settings classes as construction arguments. 這些設定類別為XamlXmlWriterSettingsXamlObjectWriterSettingsThese settings classes are XamlXmlWriterSettings and XamlObjectWriterSettings. 設定類別會定義實際的設定值, 並根據XamlWriterSettings, 讓它們可以XamlWriterSettings使用合併功能。The settings classes define actual settings values and are based on XamlWriterSettings, so that they can use the XamlWriterSettings merge feature.

建構函式

XamlWriter()

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

屬性

IsDisposed

取得是否已呼叫 Dispose(Boolean)Gets whether Dispose(Boolean) has been called.

SchemaContext

在衍生類別中實作時,取得作用中 XAML 結構描述內容。When implemented in a derived class, gets the active XAML schema context.

方法

Close()

關閉 XAML 寫入器物件。Closes the XAML writer object.

Dispose(Boolean)

釋放 XamlWriter 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the XamlWriter and optionally releases the managed resources.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
WriteEndMember()

在衍生類別中實作時,產生結束成員節點的表示。When implemented in a derived class, produces the representation of an end member node.

WriteEndObject()

在衍生類別中實作時,產生結束物件節點的表示。When implemented in a derived class, produces the representation of an end object node.

WriteGetObject()

在衍生類別中實作時,針對物件是所設定屬性的預設值或隱含值 (而非在輸入 XAML 節點集內特地以物件值指定) 的情況,產生物件。When implemented in a derived class, produces an object for cases where the object is a default or implicit value of the property being set, instead of being specified as a discrete object value in the input XAML node set.

WriteNamespace(NamespaceDeclaration)

在衍生類別中實作時,寫入 XAML 命名空間宣告節點。When implemented in a derived class, writes a XAML namespace declaration node.

WriteNode(XamlReader)

根據來自 XAML 讀取器的節點型別 (NodeType) 執行切換,並呼叫寫入器實作的相關 Write 方法。Performs switching based on node type from the XAML reader (NodeType) and calls the relevant Write method for the writer implementation.

WriteStartMember(XamlMember)

在衍生類別中實作時,寫入開始成員節點的表示。When implemented in a derived class, writes the representation of a start member node.

WriteStartObject(XamlType)

在衍生類別中實作時,寫入開始物件節點的表示。When implemented in a derived class, writes the representation of a start object node.

WriteValue(Object)

在衍生類別中實作時,寫入值節點。When implemented in a derived class, writes a value node.

明確介面實作

IDisposable.Dispose()

請參閱 Dispose()See Dispose().

適用於