XmlObjectSerializer.WriteStartObject XmlObjectSerializer.WriteStartObject XmlObjectSerializer.WriteStartObject XmlObjectSerializer.WriteStartObject Method

Definition

Writes only the starting XML element to an XML document or stream.

Overloads

WriteStartObject(XmlDictionaryWriter, Object) WriteStartObject(XmlDictionaryWriter, Object) WriteStartObject(XmlDictionaryWriter, Object) WriteStartObject(XmlDictionaryWriter, Object)

Writes the start of the object's data as an opening XML element using the specified XmlDictionaryWriter.

WriteStartObject(XmlWriter, Object) WriteStartObject(XmlWriter, Object) WriteStartObject(XmlWriter, Object) WriteStartObject(XmlWriter, Object)

Writes the start of the object's data as an opening XML element using the specified XmlWriter.

Remarks

The WriteStartObject, WriteObjectContent, and WriteEndObject methods must be implemented. The three methods are used in succession to write the complete serialization using the pattern: write start, write content, and write end. If the implementation writes using XML elements, attributes can be inserted before writing the contents of the object. The three methods are also called by the virtual implementation of the WriteObject method.

WriteStartObject(XmlDictionaryWriter, Object) WriteStartObject(XmlDictionaryWriter, Object) WriteStartObject(XmlDictionaryWriter, Object) WriteStartObject(XmlDictionaryWriter, Object)

Writes the start of the object's data as an opening XML element using the specified XmlDictionaryWriter.

public:
 abstract void WriteStartObject(System::Xml::XmlDictionaryWriter ^ writer, System::Object ^ graph);
public abstract void WriteStartObject (System.Xml.XmlDictionaryWriter writer, object graph);
abstract member WriteStartObject : System.Xml.XmlDictionaryWriter * obj -> unit
Public MustOverride Sub WriteStartObject (writer As XmlDictionaryWriter, graph As Object)

Parameters

graph
Object Object Object Object

The object to serialize.

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 objects to serialize has been exceeded. Check the MaxItemsInObjectGraph property.

WriteStartObject(XmlWriter, Object) WriteStartObject(XmlWriter, Object) WriteStartObject(XmlWriter, Object) WriteStartObject(XmlWriter, Object)

Writes the start of the object's data as an opening XML element using the specified XmlWriter.

public:
 virtual void WriteStartObject(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
public virtual void WriteStartObject (System.Xml.XmlWriter writer, object graph);
abstract member WriteStartObject : System.Xml.XmlWriter * obj -> unit
override this.WriteStartObject : System.Xml.XmlWriter * obj -> unit
Public Overridable Sub WriteStartObject (writer As XmlWriter, graph As Object)

Parameters

writer
XmlWriter XmlWriter XmlWriter XmlWriter

An XmlWriter used to write the XML document.

graph
Object Object Object Object

The object to serialize.

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 objects to serialize has been exceeded. Check the MaxItemsInObjectGraph property.

Applies to