ContentWriter.WriteObject Generic Method (T, ContentTypeWriter)

Writes a single object to the output binary, using the specified type hint and writer worker.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

Syntax

public void WriteObject<T> (
         T value,
         ContentTypeWriter typeWriter
)

Type Parameters

  • T
    The type of value.

Parameters

  • value
    The value to write.
  • typeWriter
    The content type writer.

Remarks

The type hint should be retrieved from the Initialize method of the ContentTypeWriter that is calling WriteObject, by calling GetTypeWriter and passing it the type of the field used to hold the value being serialized. If the hint type is a sealed value type (which cannot be null or hold a polymorphic object instance) this method skips writing the usual type identifier.

See Also

Reference

ContentWriter Class
ContentWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Platforms

Windows XP SP2, Windows Vista