C# Класс Catel.Runtime.Serialization.Xml.DataContractSerializerFactory

Default implementation of the IDataContractSerializerFactory interface.
Наследование: IDataContractSerializerFactory
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

AddTypeToKnownTypesIfSerializable() защищенный Метод

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.
Результат bool

AllowNonPublicReflection() защищенный Метод

Returns whether non-public reflection is allowed on the specified type.
protected AllowNonPublicReflection ( Type type ) : bool
type System.Type The type.
Результат bool

DataContractSerializerFactory() публичный Метод

Initializes a new instance of the DataContractSerializerFactory class.
public DataContractSerializerFactory ( ) : System
Результат System

GetDataContractSerializer() публичный Метод

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.
Результат System.Runtime.Serialization.DataContractSerializer

GetKnownTypes() защищенный Метод

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].
Результат void

GetKnownTypesViaAttributes() защищенный Метод

Gets the known types via attributes.
The is null.
protected GetKnownTypesViaAttributes ( Type type ) : System.Type[]
type System.Type The type.
Результат System.Type[]

IsTypeSerializable() защищенный Метод

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.
Результат bool

ShouldTypeBeIgnored() защищенный Метод

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.
Результат bool