ContentWriter.WriteObject Generic Method (T, ContentTypeWriter)

Note

This generic method is available only when developing for Windows.

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

Syntax

'Declaration
Public Sub WriteObject(Of T) ( _
         value As T, _
         typeWriter As ContentTypeWriter _
)
public void WriteObject<T> (
         T value,
         ContentTypeWriter typeWriter
)
public:
generic<typename T>
void WriteObject(
         T value,
         ContentTypeWriter typeWriter
)

Type Parameters

  • T
    The type of value.

Parameters

  • value
    Type: T
    The value to write.
  • typeWriter
    Type: ContentTypeWriter
    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.

Requirements

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler

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

See Also

Reference

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

Platforms

Windows 7, Windows Vista, Windows XP