NetDataContractSerializer.WriteObject(XmlWriter, Object) 方法

定義

使用指定的 XmlWriter,將物件的完整內容 (開始、內容和結束) 寫入至 XML 文件或資料流。

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

用來撰寫 XML 文件或資料流的 XmlWriter

graph
Object

包含要寫入之內容的物件。

例外狀況

正在序列化的型別不符合資料合約規則。 例如,DataContractAttribute 屬性尚未套用至此型別。

正在序列化的執行個體發生問題。

已超過要序列化的物件數目上限。 檢查 MaxItemsInObjectGraph 屬性。

適用於