XamlWriter XamlWriter XamlWriter XamlWriter Class

定義

提供 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
繼承
XamlWriterXamlWriterXamlWriterXamlWriter
衍生
實作

備註

兩個最相關的實際的衍生類別XamlWriterXamlXmlWriterXamlObjectWriter類別,如下列詳細資料說明了: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基底建構函式不會使用此設定類別,做為引數,也不會任何其他XamlWriter成員。The XamlWriter base constructor does not use this settings class as an argument, nor does any other XamlWriter member. 相反地,XamlXmlWriterXamlObjectWriter類別包括自己的設定類別,做為建構引數。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() XamlWriter() XamlWriter()

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

屬性

IsDisposed IsDisposed IsDisposed IsDisposed

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

SchemaContext SchemaContext SchemaContext SchemaContext

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

方法

Close() Close() Close() Close()

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

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)
WriteEndMember() WriteEndMember() WriteEndMember() WriteEndMember()

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

WriteEndObject() WriteEndObject() WriteEndObject() WriteEndObject()

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

WriteGetObject() WriteGetObject() WriteGetObject() 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) WriteNamespace(NamespaceDeclaration) WriteNamespace(NamespaceDeclaration) WriteNamespace(NamespaceDeclaration)

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

WriteNode(XamlReader) WriteNode(XamlReader) WriteNode(XamlReader) 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) WriteStartMember(XamlMember) WriteStartMember(XamlMember) WriteStartMember(XamlMember)

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

WriteStartObject(XamlType) WriteStartObject(XamlType) WriteStartObject(XamlType) WriteStartObject(XamlType)

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

WriteValue(Object) WriteValue(Object) WriteValue(Object) WriteValue(Object)

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

明確介面實作

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

請參閱 Dispose()See Dispose().

適用於