NetDataContractSerializer.WriteObject(XmlWriter, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將物件的完整內容(起始、內容及結束)寫入 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)
參數
- graph
- Object
包含要寫入內容的物件。
例外狀況
被序列化的類型不符合資料合約規則。 例如, DataContractAttribute 屬性尚未套用到型別。
實例被序列化時存在問題。
可序列化的物件數量已超過。 檢查 MaxItemsInObjectGraph 屬性。