C# Class Tp.Integration.Messages.ServiceBus.Serialization.XmlDeserializer

Deserializes complex objects serialized with the XmlSerializer.
Inheritance: IDisposable
Afficher le fichier Open project: TargetProcess/Target-Process-Plugins Class Usage Examples

Private Properties

Свойство Type Description
CreateArrayInstance System.Array
CreateInstance object
GetObjectInfo ObjectInfo
TranslateTypeByKey TypeInfo

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

AddAssemblyRegisterToCache() protected méthode

Adds the assembly register items to the assembly cache.
protected AddAssemblyRegisterToCache ( ) : void
Résultat void

CreateType() protected méthode

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
Résultat System.Type

CreateType() protected méthode

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
Résultat System.Type

Deserialize() public méthode

Deserialzes an object from XmlDocument.
public Deserialize ( XmlDocument document ) : object
document System.Xml.XmlDocument
Résultat object

Deserialize() public méthode

Deserializes an Object from the specified XmlNode.
public Deserialize ( XmlNode node ) : object
node System.Xml.XmlNode
Résultat object

Deserialize() public méthode

Deserialzes an object from a xml file.
public Deserialize ( string filename ) : object
filename string
Résultat object

Dispose() public méthode

Dispose, release references.
public Dispose ( ) : void
Résultat void

GetArrayLength() protected méthode

Returns the length of the array of a arry-XmlNode.
protected GetArrayLength ( XmlNode parent ) : int
parent System.Xml.XmlNode
Résultat int

GetAssembly() protected méthode

protected GetAssembly ( String assembly ) : Assembly
assembly String
Résultat System.Reflection.Assembly

GetAttributeValue() protected méthode

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
Résultat string

GetBinaryConstructorType() protected méthode

protected GetBinaryConstructorType ( XmlNode node ) : TypeInfo
node System.Xml.XmlNode
Résultat TypeInfo

GetConverter() protected méthode

Returns the TypeConverter of a Type.
protected GetConverter ( Type type ) : TypeConverter
type System.Type
Résultat System.ComponentModel.TypeConverter

GetObject() protected méthode

Creates an instance by the contents of the given XmlNode.
protected GetObject ( XmlNode node ) : object
node System.Xml.XmlNode
Résultat object

GetProperties() protected méthode

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
Résultat void

HasBinaryConstructor() protected méthode

protected HasBinaryConstructor ( XmlNode node ) : bool
node System.Xml.XmlNode
Résultat bool

ParseTypeDictionary() protected méthode

Parses the TypeDictionary (if given).
The TypeDictionary is Hashtable in which TypeInfo items are stored.
protected ParseTypeDictionary ( XmlNode parentNode ) : Hashtable
parentNode System.Xml.XmlNode
Résultat System.Collections.Hashtable

RegisterAssemblies() public méthode

Registers a list of assemblies.
public RegisterAssemblies ( Assembly assemblies ) : int
assemblies System.Reflection.Assembly
Résultat int

RegisterAssemblies() public méthode

Registers a list of assemblies.
public RegisterAssemblies ( List assemblies ) : int
assemblies List
Résultat int

RegisterAssembly() public méthode

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
Résultat void

Reset() public méthode

Clears the typedictionary collection.
public Reset ( ) : void
Résultat void

SetCollectionValues() protected méthode

Sets the entries on an ICollection implementation.
protected SetCollectionValues ( ICollection coll, XmlNode parentNode ) : void
coll ICollection
parentNode System.Xml.XmlNode
Résultat void

SetDictionaryValues() protected méthode

Sets the entries of an IDictionary implementation.
protected SetDictionaryValues ( IDictionary dictionary, XmlNode parentNode ) : void
dictionary IDictionary
parentNode System.Xml.XmlNode
Résultat void

SetListValues() protected méthode

Sets the entries on an IList implementation.
protected SetListValues ( IList list, XmlNode parentNode ) : void
list IList
parentNode System.Xml.XmlNode
Résultat void

XmlDeserializer() public méthode

public XmlDeserializer ( ) : System
Résultat System

XmlDeserializer() public méthode

public XmlDeserializer ( Action typeNotFoundAction ) : System
typeNotFoundAction Action
Résultat System