SerializationManager

Name Value
Assembly Catel.Core
Namespace Catel.Runtime.Serialization
Available on .NET Framework 4.5, .NET Framework 4.6, Portable Class Libraries, Xamarin - Android, Xamarin - iOS
public class SerializationManager : ISerializationManager

Implements interfaces ISerializationManager

Manager which is responsible for discovering what fields and properties of an object should be serialized.

Fields

Events

CacheInvalidated

Occurs when the cache for a specific type has been invalidated.

Methods

AddSerializerModifier(Type type, Type serializerModifierType)

Adds the serializer modifier for a specific type.

Parameters

Name Description
type The type.
serializerModifierType Type of the serializer modifier.

Exceptions

Name Description
ArgumentNullException The type isnull.

Clear(Type type)

Clears the specified type from cache so it will be evaluated.

Parameters

Name Description
type The type.

Exceptions

Name Description
ArgumentNullException The type isnull.

FindSerializerModifiers(Type type)

Finds the serializer modifiers.

Parameters

Name Description
type The type.

Returns

The list of modifier attributes found.

GetCatelProperties(Type type, bool includeModelBaseProperties)

Gets the catel properties.

Parameters

Name Description
type Type of the model.
includeModelBaseProperties if set totrue, also include model base properties.

Returns

A hash set containing the Catel properties.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetCatelPropertiesToSerialize(Type type)

Gets the catel properties to serialize.

Parameters

Name Description
type The type.

Returns

The list of properties to serialize.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetCatelPropertyNames(Type type, bool includeModelBaseProperties)

Gets the catel property names.

Parameters

Name Description
type Type of the model.
includeModelBaseProperties if set totrue, also include model base properties.

Returns

A hash set containing the Catel property names.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetFieldNames(Type type)

Gets the field names.

Parameters

Name Description
type Type of the model.

Returns

A hash set containing the field names.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetFields(Type type)

Gets the fields

Parameters

Name Description
type Type of the model.

Returns

A hash set containing the fields.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetFieldsToSerialize(Type type)

Gets the fields to serialize for the specified object.

Parameters

Name Description
type The type.

Returns

The list of fields to serialize.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetRegularProperties(Type type)

Gets the regular properties.

Parameters

Name Description
type Type of the model.

Returns

A hash set containing the regular properties.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetRegularPropertiesToSerialize(Type type)

Gets the properties to serialize for the specified object.

Parameters

Name Description
type The type.

Returns

The list of properties to serialize.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetRegularPropertyNames(Type type)

Gets the regular property names.

Parameters

Name Description
type Type of the model.

Returns

A hash set containing the regular property names.

Exceptions

Name Description
ArgumentNullException The type isnull.

GetSerializerModifiers(Type type)

Gets the serializer modifiers for the specified type. Note that the order is important because the modifiers will be called in the returned order during serialization and in reversed order during deserialization.

Parameters

Name Description
type The type.

Returns

An array containing the modifiers. Nevernull, but can be an empty array.

Exceptions

Name Description
ArgumentNullException The type isnull.

RemoveSerializerModifier(Type type, Type serializerModifierType)

Removes the serializer modifier for a specific type.

Parameters

Name Description
type The type.
serializerModifierType Type of the serializer modifier.

Exceptions

Name Description
ArgumentNullException The type isnull.

Warmup(Type type)

Warmups the specified type by calling all the methods for the specified type.

Parameters

Name Description
type The type.

Exceptions

Name Description
ArgumentNullException The type isnull.

Have a question about Catel? Use StackOverflow with the Catel tag!


Discussion