IFormatter Interface
TOC
Collapse the table of content
Expand the table of content

IFormatter Interface

 

Provides functionality for formatting serialized objects.

Namespace:   System.Runtime.Serialization
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(true)]
public interface IFormatter

NameDescription
System_CAPS_pubpropertyBinder

Gets or sets the SerializationBinder that performs type lookups during deserialization.

System_CAPS_pubpropertyContext

Gets or sets the StreamingContext used for serialization and deserialization.

System_CAPS_pubpropertySurrogateSelector

Gets or sets the SurrogateSelector used by the current formatter.

NameDescription
System_CAPS_pubmethodDeserialize(Stream)

Deserializes the data on the provided stream and reconstitutes the graph of objects.

System_CAPS_pubmethodSerialize(Stream, Object)

Serializes an object, or graph of objects with the given root to the provided stream.

This interface must be implemented by any class identified as a formatter in the System.Runtime.Serialization architecture.

Objects controlling their own serialization can do so by implementing the ISerializable interface. In order for an object to be serialized, you must mark that object as being serializable. You can do this by applying the serializable attribute to a class. If any object in the graph is not serializable, serialization will fail.

Notes to Implementers:

All formatters must implement this interface. Use Serialize to serialize an object or graph of objects. Use Deserialize to deserialize a stream and create a clone of the original object or graph of objects.

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft