C# Class Catel.Runtime.Serialization.Xml.DataContractSerializerFactory

Default implementation of the IDataContractSerializerFactory interface.
Inheritance: IDataContractSerializerFactory
Afficher le fichier Open project: Catel/Catel

Méthodes publiques

Méthode Description
DataContractSerializerFactory ( ) : System

Initializes a new instance of the DataContractSerializerFactory class.

GetDataContractSerializer ( Type serializingType, Type typeToSerialize, string xmlName, string rootNamespace = null, List additionalKnownTypes = null ) : DataContractSerializer

Gets the Data Contract serializer for a specific type. This method caches serializers so the performance can be improved when a serializer is used more than once.

Méthodes protégées

Méthode Description
AddTypeToKnownTypesIfSerializable ( Type typeToAdd, XmlSerializerTypeInfo serializerTypeInfo ) : bool

Adds the type to the known types if the type is serializable.

AllowNonPublicReflection ( Type type ) : bool

Returns whether non-public reflection is allowed on the specified type.

GetKnownTypes ( Type type, XmlSerializerTypeInfo serializerTypeInfo, bool resolveAbstractClassesAndInterfaces = true ) : void

Gets the known types inside the specific type.

GetKnownTypesViaAttributes ( Type type ) : System.Type[]

Gets the known types via attributes.

IsTypeSerializable ( Type type, XmlSerializerTypeInfo serializerTypeInfo ) : bool

Determines whether the specified type is serializable.

ShouldTypeBeIgnored ( Type type, XmlSerializerTypeInfo serializerTypeInfo ) : bool

Determines whether the type should be handled.

Private Methods

Méthode Description
AddTypeMembers ( Type type, XmlSerializerTypeInfo serializerTypeInfo ) : void
GetDataContractSerializer ( Type serializingType, Type typeToSerialize, string xmlName, string rootNamespace, object serializingObject, List additionalKnownTypes = null ) : DataContractSerializer
GetKnownTypesForInstance ( object obj, XmlSerializerTypeInfo serializerTypeInfo ) : void
GetKnownTypesForItems ( Type type, XmlSerializerTypeInfo serializerTypeInfo ) : void

Gets the known types of IEnumerable type.

GetKnownTypesForItemsInstance ( object obj, XmlSerializerTypeInfo serializerTypeInfo ) : void

Method Details

AddTypeToKnownTypesIfSerializable() protected méthode

Adds the type to the known types if the type is serializable.
protected AddTypeToKnownTypesIfSerializable ( Type typeToAdd, XmlSerializerTypeInfo serializerTypeInfo ) : bool
typeToAdd System.Type The type to add.
serializerTypeInfo XmlSerializerTypeInfo The serializer type info.
Résultat bool

AllowNonPublicReflection() protected méthode

Returns whether non-public reflection is allowed on the specified type.
protected AllowNonPublicReflection ( Type type ) : bool
type System.Type The type.
Résultat bool

DataContractSerializerFactory() public méthode

Initializes a new instance of the DataContractSerializerFactory class.
public DataContractSerializerFactory ( ) : System
Résultat System

GetDataContractSerializer() public méthode

Gets the Data Contract serializer for a specific type. This method caches serializers so the performance can be improved when a serializer is used more than once.
The is null. The is null. The is null or whitespace.
public GetDataContractSerializer ( Type serializingType, Type typeToSerialize, string xmlName, string rootNamespace = null, List additionalKnownTypes = null ) : DataContractSerializer
serializingType System.Type The type that is currently (de)serializing.
typeToSerialize System.Type The type to (de)serialize.
xmlName string Name of the property as known in XML.
rootNamespace string The root namespace.
additionalKnownTypes List A list of additional types to add to the known types.
Résultat System.Runtime.Serialization.DataContractSerializer

GetKnownTypes() protected méthode

Gets the known types inside the specific type.
protected GetKnownTypes ( Type type, XmlSerializerTypeInfo serializerTypeInfo, bool resolveAbstractClassesAndInterfaces = true ) : void
type System.Type The type.
serializerTypeInfo XmlSerializerTypeInfo The serializer type info.
resolveAbstractClassesAndInterfaces bool if set to true [resolve abstract classes and interfaces].
Résultat void

GetKnownTypesViaAttributes() protected méthode

Gets the known types via attributes.
The is null.
protected GetKnownTypesViaAttributes ( Type type ) : System.Type[]
type System.Type The type.
Résultat System.Type[]

IsTypeSerializable() protected méthode

Determines whether the specified type is serializable.
protected IsTypeSerializable ( Type type, XmlSerializerTypeInfo serializerTypeInfo ) : bool
type System.Type The type.
serializerTypeInfo XmlSerializerTypeInfo The serializer type information.
Résultat bool

ShouldTypeBeIgnored() protected méthode

Determines whether the type should be handled.
protected ShouldTypeBeIgnored ( Type type, XmlSerializerTypeInfo serializerTypeInfo ) : bool
type System.Type The type.
serializerTypeInfo XmlSerializerTypeInfo The serializer type info.
Résultat bool