C# Класс Tp.Integration.Messages.ServiceBus.Serialization.XmlDeserializer

Deserializes complex objects serialized with the XmlSerializer.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CreateArrayInstance System.Array
CreateInstance object
GetObjectInfo ObjectInfo
TranslateTypeByKey TypeInfo

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

Метод Описание
Deserialize ( XmlDocument document ) : object

Deserialzes an object from XmlDocument.

Deserialize ( XmlNode node ) : object

Deserializes an Object from the specified XmlNode.

Deserialize ( string filename ) : object

Deserialzes an object from a xml file.

Dispose ( ) : void

Dispose, release references.

RegisterAssemblies ( Assembly assemblies ) : int

Registers a list of assemblies.

RegisterAssemblies ( List assemblies ) : int

Registers a list of assemblies.

RegisterAssembly ( Assembly assembly ) : void

Registers an Assembly.

Register Assemblies which are not known at compile time, e.g. PlugIns or whatever.

Reset ( ) : void

Clears the typedictionary collection.

XmlDeserializer ( ) : System
XmlDeserializer ( Action typeNotFoundAction ) : System

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

Метод Описание
AddAssemblyRegisterToCache ( ) : void

Adds the assembly register items to the assembly cache.

CreateType ( String assembly, string type ) : Type

Creates a type from the specified assembly and type names. In case of failure null will be returned.

CreateType ( TypeInfo info ) : Type

Creates a type from the specified assembly and type names included in the TypeInfo parameter. In case of failure null will be returned.

GetArrayLength ( XmlNode parent ) : int

Returns the length of the array of a arry-XmlNode.

GetAssembly ( String assembly ) : Assembly

GetAttributeValue ( XmlNode node, string name ) : string

Returns the value or the attribute with the specified name from the given node if it is not null or empty.

GetBinaryConstructorType ( XmlNode node ) : TypeInfo

GetConverter ( Type type ) : TypeConverter

Returns the TypeConverter of a Type.

GetObject ( XmlNode node ) : object

Creates an instance by the contents of the given XmlNode.

GetProperties ( object parent, XmlNode node ) : void

Reads the properties of the specified node and sets them an the parent object.

This is the central method which is called recursivly!

HasBinaryConstructor ( XmlNode node ) : bool

ParseTypeDictionary ( XmlNode parentNode ) : Hashtable

Parses the TypeDictionary (if given).

The TypeDictionary is Hashtable in which TypeInfo items are stored.

SetCollectionValues ( ICollection coll, XmlNode parentNode ) : void

Sets the entries on an ICollection implementation.

SetDictionaryValues ( IDictionary dictionary, XmlNode parentNode ) : void

Sets the entries of an IDictionary implementation.

SetListValues ( IList list, XmlNode parentNode ) : void

Sets the entries on an IList implementation.

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

Метод Описание
CreateArrayInstance ( ObjectInfo info, int length ) : Array

Creates an instance of an Array by the specified ObjectInfo.

CreateInstance ( ObjectInfo info ) : object

Creates an instance by the specified ObjectInfo.

GetObjectInfo ( XmlNode node ) : ObjectInfo

Gets an ObjectInfo instance by the attributes of the specified XmlNode.

TranslateTypeByKey ( String key ) : TypeInfo

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

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

Adds the assembly register items to the assembly cache.
protected AddAssemblyRegisterToCache ( ) : void
Результат void

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

Creates a type from the specified assembly and type names. In case of failure null will be returned.
protected CreateType ( String assembly, string type ) : Type
assembly String
type string
Результат System.Type

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

Creates a type from the specified assembly and type names included in the TypeInfo parameter. In case of failure null will be returned.
protected CreateType ( TypeInfo info ) : Type
info TypeInfo
Результат System.Type

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

Deserialzes an object from XmlDocument.
public Deserialize ( XmlDocument document ) : object
document System.Xml.XmlDocument
Результат object

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

Deserializes an Object from the specified XmlNode.
public Deserialize ( XmlNode node ) : object
node System.Xml.XmlNode
Результат object

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

Deserialzes an object from a xml file.
public Deserialize ( string filename ) : object
filename string
Результат object

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

Dispose, release references.
public Dispose ( ) : void
Результат void

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

Returns the length of the array of a arry-XmlNode.
protected GetArrayLength ( XmlNode parent ) : int
parent System.Xml.XmlNode
Результат int

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

protected GetAssembly ( String assembly ) : Assembly
assembly String
Результат System.Reflection.Assembly

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

Returns the value or the attribute with the specified name from the given node if it is not null or empty.
protected GetAttributeValue ( XmlNode node, string name ) : string
node System.Xml.XmlNode
name string
Результат string

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

protected GetBinaryConstructorType ( XmlNode node ) : TypeInfo
node System.Xml.XmlNode
Результат TypeInfo

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

Returns the TypeConverter of a Type.
protected GetConverter ( Type type ) : TypeConverter
type System.Type
Результат System.ComponentModel.TypeConverter

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

Creates an instance by the contents of the given XmlNode.
protected GetObject ( XmlNode node ) : object
node System.Xml.XmlNode
Результат object

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

Reads the properties of the specified node and sets them an the parent object.
This is the central method which is called recursivly!
protected GetProperties ( object parent, XmlNode node ) : void
parent object
node System.Xml.XmlNode
Результат void

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

protected HasBinaryConstructor ( XmlNode node ) : bool
node System.Xml.XmlNode
Результат bool

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

Parses the TypeDictionary (if given).
The TypeDictionary is Hashtable in which TypeInfo items are stored.
protected ParseTypeDictionary ( XmlNode parentNode ) : Hashtable
parentNode System.Xml.XmlNode
Результат System.Collections.Hashtable

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

Registers a list of assemblies.
public RegisterAssemblies ( Assembly assemblies ) : int
assemblies System.Reflection.Assembly
Результат int

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

Registers a list of assemblies.
public RegisterAssemblies ( List assemblies ) : int
assemblies List
Результат int

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

Registers an Assembly.
Register Assemblies which are not known at compile time, e.g. PlugIns or whatever.
public RegisterAssembly ( Assembly assembly ) : void
assembly System.Reflection.Assembly
Результат void

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

Clears the typedictionary collection.
public Reset ( ) : void
Результат void

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

Sets the entries on an ICollection implementation.
protected SetCollectionValues ( ICollection coll, XmlNode parentNode ) : void
coll ICollection
parentNode System.Xml.XmlNode
Результат void

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

Sets the entries of an IDictionary implementation.
protected SetDictionaryValues ( IDictionary dictionary, XmlNode parentNode ) : void
dictionary IDictionary
parentNode System.Xml.XmlNode
Результат void

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

Sets the entries on an IList implementation.
protected SetListValues ( IList list, XmlNode parentNode ) : void
list IList
parentNode System.Xml.XmlNode
Результат void

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

public XmlDeserializer ( ) : System
Результат System

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

public XmlDeserializer ( Action typeNotFoundAction ) : System
typeNotFoundAction Action
Результат System