Redigera

Dela via


NetDataContractSerializer.WriteObject(XmlWriter, Object) Method

Definition

Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified 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)

Parameters

writer
XmlWriter

An XmlWriter used to write the XML document or stream.

graph
Object

The object containing the content to write.

Exceptions

the type being serialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.

there is a problem with the instance being serialized.

the maximum number of object to serialize has been exceeded. Check the MaxItemsInObjectGraph property.

Applies to