Export (0) Print
Expand All

Formatter Class

Provides base functionality for the common language runtime serialization formatters.

This API is not CLS-compliant. 

System.Object
  System.Runtime.Serialization.Formatter

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

[SerializableAttribute]
[CLSCompliantAttribute(false)]
[ComVisibleAttribute(true)]
public abstract class Formatter : IFormatter

The Formatter type exposes the following members.

  NameDescription
Protected methodFormatterInitializes a new instance of the Formatter class.
Top

  NameDescription
Public propertyBinderWhen overridden in a derived class, gets or sets the SerializationBinder used with the current formatter.
Public propertyContextWhen overridden in a derived class, gets or sets the StreamingContext used for the current serialization.
Public propertySurrogateSelectorWhen overridden in a derived class, gets or sets the ISurrogateSelector used with the current formatter.
Top

  NameDescription
Public methodDeserializeWhen overridden in a derived class, deserializes the stream attached to the formatter when it was created, creating a graph of objects identical to the graph originally serialized into that stream.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Protected methodGetNextReturns the next object to serialize, from the formatter's internal work queue.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodScheduleSchedules an object for later serialization.
Public methodSerializeWhen overridden in a derived class, serializes the graph of objects with the specified root to the stream already attached to the formatter.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodWriteArrayWhen overridden in a derived class, writes an array to the stream already attached to the formatter.
Protected methodWriteBooleanWhen overridden in a derived class, writes a Boolean value to the stream already attached to the formatter.
Protected methodWriteByteWhen overridden in a derived class, writes an 8-bit unsigned integer to the stream already attached to the formatter.
Protected methodWriteCharWhen overridden in a derived class, writes a Unicode character to the stream already attached to the formatter.
Protected methodWriteDateTimeWhen overridden in a derived class, writes a DateTime value to the stream already attached to the formatter.
Protected methodWriteDecimalWhen overridden in a derived class, writes a Decimal value to the stream already attached to the formatter.
Protected methodWriteDoubleWhen overridden in a derived class, writes a double-precision floating-point number to the stream already attached to the formatter.
Protected methodWriteInt16When overridden in a derived class, writes a 16-bit signed integer to the stream already attached to the formatter.
Protected methodWriteInt32When overridden in a derived class, writes a 32-bit signed integer to the stream.
Protected methodWriteInt64When overridden in a derived class, writes a 64-bit signed integer to the stream.
Protected methodWriteMemberInspects the type of data received, and calls the appropriate Write method to perform the write to the stream already attached to the formatter.
Protected methodWriteObjectRefWhen overridden in a derived class, writes an object reference to the stream already attached to the formatter.
Protected methodWriteSByteWhen overridden in a derived class, writes an 8-bit signed integer to the stream already attached to the formatter.
Protected methodWriteSingleWhen overridden in a derived class, writes a single-precision floating-point number to the stream already attached to the formatter.
Protected methodWriteTimeSpanWhen overridden in a derived class, writes a TimeSpan value to the stream already attached to the formatter.
Protected methodWriteUInt16When overridden in a derived class, writes a 16-bit unsigned integer to the stream already attached to the formatter.
Protected methodWriteUInt32When overridden in a derived class, writes a 32-bit unsigned integer to the stream already attached to the formatter.
Protected methodWriteUInt64When overridden in a derived class, writes a 64-bit unsigned integer to the stream already attached to the formatter.
Protected methodWriteValueTypeWhen overridden in a derived class, writes a value of the given type to the stream already attached to the formatter.
Top

  NameDescription
Protected fieldm_idGeneratorContains the ObjectIDGenerator used with the current formatter.
Protected fieldm_objectQueueContains a Queue of the objects left to serialize.
Top

Formatter is the abstract base class for all runtime serialization formatters, and provides some helper methods for implementing the IFormatter interface. The Formatter also manages queuing objects for serialization and generating IDs on a per-object basis.

Notes to Inheritors

When you inherit from Formatter, you must override the following members:

.NET Framework

Supported in: 4.6, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft