ContentTypeWriter

class ContentTypeWriter : System.Object

Provides methods and properties for compiling a specific managed type into a binary format.

readonly bool CanDeserializeIntoExistingObject

Determines if deserialization into an existing object is possible.

Value:true if the object can be deserialized into; false otherwise.
readonly System.Type TargetType

Gets the type handled by this compiler component.

Value:The type handled by this compiler component.
readonly int TypeVersion

Gets a format version number for this type.

Value:A format version number for this type.
public abstract string GetRuntimeReader(TargetPlatform targetPlatform)

Gets the assembly qualified name of the runtime loader for this type.

Parameters:
  • targetPlatform (Microsoft.Xna.Framework.Content.Pipeline.TargetPlatform) – Name of the platform.
Returns:

Name of the runtime loader.

public string GetRuntimeType(TargetPlatform targetPlatform)

Gets the assembly qualified name of the runtime target type. The runtime target type often matches the design time type, but may differ.

Parameters:
  • targetPlatform (Microsoft.Xna.Framework.Content.Pipeline.TargetPlatform) – The target platform.
Returns:

The qualified name.

void OnAddedToContentWriter(ContentWriter writer)

Allows type writers to add their element type writers to the content writer.

Parameters:
  • writer (Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentWriter) – The content writer.
bool ShouldCompressContent(TargetPlatform targetPlatform, System.Object value)

Indicates whether a given type of content should be compressed.

Parameters:
  • targetPlatform (Microsoft.Xna.Framework.Content.Pipeline.TargetPlatform) – The target platform of the content build.
  • value (System.Object) – The object about to be serialized, or null if a collection of objects is to be serialized.
Returns:

true if the content of the requested type should be compressed; false otherwise.

abstract void Write(ContentWriter output, System.Object value)

Compiles an object into binary format.

Parameters:
  • output (Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentWriter) – The content writer serializing the value.
  • value (System.Object) – The resultant object.