XmlObjectSerializer.WriteObject Method (XmlDictionaryWriter, Object)

Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified XmlDictionaryWriter.

Namespace: System.Runtime.Serialization
Assembly: System.Runtime.Serialization (in system.runtime.serialization.dll)

public:
virtual void WriteObject (
	XmlDictionaryWriter^ writer, 
	Object^ graph
)
public void WriteObject (
	XmlDictionaryWriter writer, 
	Object graph
)
public function WriteObject (
	writer : XmlDictionaryWriter, 
	graph : Object
)
Not applicable.

Parameters

writer

An XmlDictionaryWriter used to write the content to the XML document or stream.

graph

The object that contains the content to write.

Exception typeCondition

InvalidDataContractException

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

SerializationException

there is a problem with the instance being serialized.

QuotaExceededException

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

This is a virtual method and has a default implementation that calls the WriteStartObject, WriteObjectContent, and WriteEndObject methods. Because of this, this method is intended to be the most commonly used method on a serializer.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: