KGySoft.Serialization Namespace

KGy SOFT Core Libraries Help
Contains classes both for XML and binary serialization.

Public classAnyObjectSerializerWrapper
A wrapper class for serializing any kind of object, including the ones that are not marked with SerializableAttribute or which are not supported by BinaryFormatter. Can be useful when an object is needed to be serialized with BinaryFormatter. When this object is deserialized, the clone of the wrapped original object is returned.
Public classCode exampleBinarySerializationFormatter
Serializes and deserialized objects in binary format.
See the Remarks section for details and for the differences to BinaryFormatter.
Public classBinarySerializer
Provides public static methods for binary serialization. Most of its methods will use an BinarySerializationFormatter instance internally.
See the Remarks section of the BinarySerializationFormatter class for details and an example.
Public classNameInvariantSurrogateSelector
An ISurrogateSelector implementation that makes possible to serialize and deserialize objects by IFormatters without storing field names. This provides compatibility for obfuscated and non-obfuscated versions of an assembly.
See the Remarks section for details.
Public classWeakAssemblySerializationBinder
Provides a SerializationBinder instance for IFormatter implementations that can ignore version and token information of stored assembly name. This makes possible to deserialize objects stored in different version of the original assembly.
Public classCode exampleXmlSerializer
XmlSerializer makes possible serializing and deserializing object instances into/from XML content. The class contains various overloads to support serializing directly into file or by XElement, XmlWriter, any TextWriter and any Stream implementations.
See the Remarks section for the differences compared to System.Xml.Serialization.XmlSerializer class.

Public interfaceCode exampleIBinarySerializable
Makes possible quick and compact custom serialization of a class by BinarySerializer and BinarySerializationFormatter.
See the Remarks section for examples and details.

Public enumerationBinarySerializationOptions
Options for serialization methods in BinarySerializer and BinarySerializationFormatter classes.
Public enumerationXmlSerializationOptions
Options for serializer methods of XmlSerializer class.