NetDataContractSerializer.WriteObject(XmlWriter, Object) 方法

定義

將物件的完整內容(起始、內容及結束)寫入 XML 文件或串流,並指定為 XmlWriter

public:
 override void WriteObject(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
public override void WriteObject(System.Xml.XmlWriter writer, object graph);
override this.WriteObject : System.Xml.XmlWriter * obj -> unit
Public Overrides Sub WriteObject (writer As XmlWriter, graph As Object)

參數

writer
XmlWriter

XmlWriter用於撰寫 XML 文件或串流。

graph
Object

包含要寫入內容的物件。

例外狀況

被序列化的類型不符合資料合約規則。 例如, DataContractAttribute 屬性尚未套用到型別。

實例被序列化時存在問題。

可序列化的物件數量已超過。 檢查 MaxItemsInObjectGraph 屬性。

適用於