Table of Contents

Class ContentTypeSerializer

Namespace
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Assembly
MonoGame.Framework.Content.Pipeline.dll

Provides methods for serializing and deserializing a specific managed type.

public abstract class ContentTypeSerializer
Inheritance
ContentTypeSerializer
Derived
Inherited Members

Constructors

ContentTypeSerializer(Type, string)

Initializes a new instance of the ContentTypeSerializer class.

protected ContentTypeSerializer(Type targetType, string xmlTypeName)

Parameters

targetType Type

The target type.

xmlTypeName string

The XML shortcut name.

Properties

CanDeserializeIntoExistingObject

Gets a value indicating whether this component may load data into an existing object or if it must it construct a new instance of the object before loading the data.

public virtual bool CanDeserializeIntoExistingObject { get; }

Property Value

bool

TargetType

Gets the target type.

public Type TargetType { get; }

Property Value

Type

XmlTypeName

Gets the XML shortcut name (XmlTypeName).

public string XmlTypeName { get; }

Property Value

string

Methods

Deserialize(IntermediateReader, ContentSerializerAttribute, object)

protected abstract object Deserialize(IntermediateReader input, ContentSerializerAttribute format, object existingInstance)

Parameters

input IntermediateReader
format ContentSerializerAttribute
existingInstance object

Returns

object

Initialize(IntermediateSerializer)

protected virtual void Initialize(IntermediateSerializer serializer)

Parameters

serializer IntermediateSerializer

ObjectIsEmpty(object)

Queries whether an object contains data to be serialized.

public virtual bool ObjectIsEmpty(object value)

Parameters

value object

The object to test.

Returns

bool

true if the object is empty; otherwise, false.

ScanChildren(IntermediateSerializer, ChildCallback, object)

protected virtual void ScanChildren(IntermediateSerializer serializer, ContentTypeSerializer.ChildCallback callback, object value)

Parameters

serializer IntermediateSerializer
callback ContentTypeSerializer.ChildCallback
value object

Serialize(IntermediateWriter, object, ContentSerializerAttribute)

protected abstract void Serialize(IntermediateWriter output, object value, ContentSerializerAttribute format)

Parameters

output IntermediateWriter
value object
format ContentSerializerAttribute