AgateLib.Serialization.Formatters.Xml.XmlFormatter Class Reference

The XmlFormatter class implements a custom XmlFormatter which uses the ISerializable interace. The class implements the IFormatter interface to serialize and deserialize the object to an XML representation. More...

List of all members.

Classes

class  CustomBinder
 The CustomBinder class performs the mapping to types declared in this assembly. It accumulates all types defined in the assembly this class is defined in. Optionally, an assembly can be passed as an argument. More...
struct  CustomSerializationEntry
 The CustomSerializationEntry mimics the System.Runtime.Serialization.SerializationEntry class to make it possible to create our own entries. The class acts as a placeholder for a type, it's name and it's value. This class is used in the XmlFormatter class to serialize objects. More...
class  SetArrayIndexCallback
class  SetFieldCallback

Public Types

enum  CollectionType { None, ArrayList, List, Dictionary }
 Enum which indicates which type of collection is being serialized. More...

Public Member Functions

 XmlFormatter ()
 Default constructor does nothing.
void Serialize (Stream serializationStream, object objectToSerialize)
 Serializes the passed object to the passed stream.
object Deserialize (Stream serializationStream)
 Deserializes an object from the passed stream.

Properties

SerializationBinder Binder [get, set]
 Gets or sets the type binder.
StreamingContext Context [get, set]
 Gets or sets the StreamingContext.
ISurrogateSelector SurrogateSelector [get, set]
 Gets or sets the SurrogateSelector.


Detailed Description

The XmlFormatter class implements a custom XmlFormatter which uses the ISerializable interace. The class implements the IFormatter interface to serialize and deserialize the object to an XML representation.

The class calls the methods of ISerializable on the object if the object supports this interface. If not, the class will use Reflection to examine the public fields and properties of the object.
When adding objects that inherit or implement IList, ICollection, the elements of the list should be passed as an array to SerializationInfo.


Member Enumeration Documentation

Enum which indicates which type of collection is being serialized.

Enumerator:
None  Non-collection type.

ArrayList  System.Collections.ArrayList type.

List  System.Collections.Generic.List<T> type.

Dictionary  System.Collections.Generic.Dictionary<Tkey,Tvalue> type.


Constructor & Destructor Documentation

AgateLib.Serialization.Formatters.Xml.XmlFormatter.XmlFormatter (  ) 

Default constructor does nothing.


Member Function Documentation

object AgateLib.Serialization.Formatters.Xml.XmlFormatter.Deserialize ( Stream  serializationStream  ) 

Deserializes an object from the passed stream.

Parameters:
serializationStream The stream to deserialize the object from.
Returns:
The deserialized object.

void AgateLib.Serialization.Formatters.Xml.XmlFormatter.Serialize ( Stream  serializationStream,
object  objectToSerialize 
)

Serializes the passed object to the passed stream.

Parameters:
serializationStream The stream to serialize to.
objectToSerialize The object to serialize.


Property Documentation

SerializationBinder AgateLib.Serialization.Formatters.Xml.XmlFormatter.Binder [get, set]

Gets or sets the type binder.

StreamingContext AgateLib.Serialization.Formatters.Xml.XmlFormatter.Context [get, set]

Gets or sets the StreamingContext.

ISurrogateSelector AgateLib.Serialization.Formatters.Xml.XmlFormatter.SurrogateSelector [get, set]

Gets or sets the SurrogateSelector.


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo