Formatter Formatter Formatter Formatter Class

Definition

Important

This API is not CLS-compliant.

Provides base functionality for the common language runtime serialization formatters.

public ref class Formatter abstract : System::Runtime::Serialization::IFormatter
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Formatter : System.Runtime.Serialization.IFormatter
type Formatter = class
    interface IFormatter
Public MustInherit Class Formatter
Implements IFormatter
Inheritance
FormatterFormatterFormatterFormatter
Attributes
Implements

Remarks

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:

Constructors

Formatter() Formatter() Formatter() Formatter()

Initializes a new instance of the Formatter class.

Fields

m_idGenerator m_idGenerator m_idGenerator m_idGenerator

Contains the ObjectIDGenerator used with the current formatter.

m_objectQueue m_objectQueue m_objectQueue m_objectQueue

Contains a Queue of the objects left to serialize.

Properties

Binder Binder Binder Binder

When overridden in a derived class, gets or sets the SerializationBinder used with the current formatter.

Context Context Context Context

When overridden in a derived class, gets or sets the StreamingContext used for the current serialization.

SurrogateSelector SurrogateSelector SurrogateSelector SurrogateSelector

When overridden in a derived class, gets or sets the ISurrogateSelector used with the current formatter.

Methods

Deserialize(Stream) Deserialize(Stream) Deserialize(Stream) Deserialize(Stream)

When 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.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetNext(Int64) GetNext(Int64) GetNext(Int64) GetNext(Int64)

Returns the next object to serialize, from the formatter's internal work queue.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Schedule(Object) Schedule(Object) Schedule(Object) Schedule(Object)

Schedules an object for later serialization.

Serialize(Stream, Object) Serialize(Stream, Object) Serialize(Stream, Object) Serialize(Stream, Object)

When overridden in a derived class, serializes the graph of objects with the specified root to the stream already attached to the formatter.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
WriteArray(Object, String, Type) WriteArray(Object, String, Type) WriteArray(Object, String, Type) WriteArray(Object, String, Type)

When overridden in a derived class, writes an array to the stream already attached to the formatter.

WriteBoolean(Boolean, String) WriteBoolean(Boolean, String) WriteBoolean(Boolean, String) WriteBoolean(Boolean, String)

When overridden in a derived class, writes a Boolean value to the stream already attached to the formatter.

WriteByte(Byte, String) WriteByte(Byte, String) WriteByte(Byte, String) WriteByte(Byte, String)

When overridden in a derived class, writes an 8-bit unsigned integer to the stream already attached to the formatter.

WriteChar(Char, String) WriteChar(Char, String) WriteChar(Char, String) WriteChar(Char, String)

When overridden in a derived class, writes a Unicode character to the stream already attached to the formatter.

WriteDateTime(DateTime, String) WriteDateTime(DateTime, String) WriteDateTime(DateTime, String) WriteDateTime(DateTime, String)

When overridden in a derived class, writes a DateTime value to the stream already attached to the formatter.

WriteDecimal(Decimal, String) WriteDecimal(Decimal, String) WriteDecimal(Decimal, String) WriteDecimal(Decimal, String)

When overridden in a derived class, writes a Decimal value to the stream already attached to the formatter.

WriteDouble(Double, String) WriteDouble(Double, String) WriteDouble(Double, String) WriteDouble(Double, String)

When overridden in a derived class, writes a double-precision floating-point number to the stream already attached to the formatter.

WriteInt16(Int16, String) WriteInt16(Int16, String) WriteInt16(Int16, String) WriteInt16(Int16, String)

When overridden in a derived class, writes a 16-bit signed integer to the stream already attached to the formatter.

WriteInt32(Int32, String) WriteInt32(Int32, String) WriteInt32(Int32, String) WriteInt32(Int32, String)

When overridden in a derived class, writes a 32-bit signed integer to the stream.

WriteInt64(Int64, String) WriteInt64(Int64, String) WriteInt64(Int64, String) WriteInt64(Int64, String)

When overridden in a derived class, writes a 64-bit signed integer to the stream.

WriteMember(String, Object) WriteMember(String, Object) WriteMember(String, Object) WriteMember(String, Object)

Inspects the type of data received, and calls the appropriate Write method to perform the write to the stream already attached to the formatter.

WriteObjectRef(Object, String, Type) WriteObjectRef(Object, String, Type) WriteObjectRef(Object, String, Type) WriteObjectRef(Object, String, Type)

When overridden in a derived class, writes an object reference to the stream already attached to the formatter.

WriteSByte(SByte, String) WriteSByte(SByte, String) WriteSByte(SByte, String) WriteSByte(SByte, String)

When overridden in a derived class, writes an 8-bit signed integer to the stream already attached to the formatter.

WriteSingle(Single, String) WriteSingle(Single, String) WriteSingle(Single, String) WriteSingle(Single, String)

When overridden in a derived class, writes a single-precision floating-point number to the stream already attached to the formatter.

WriteTimeSpan(TimeSpan, String) WriteTimeSpan(TimeSpan, String) WriteTimeSpan(TimeSpan, String) WriteTimeSpan(TimeSpan, String)

When overridden in a derived class, writes a TimeSpan value to the stream already attached to the formatter.

WriteUInt16(UInt16, String) WriteUInt16(UInt16, String) WriteUInt16(UInt16, String) WriteUInt16(UInt16, String)

When overridden in a derived class, writes a 16-bit unsigned integer to the stream already attached to the formatter.

WriteUInt32(UInt32, String) WriteUInt32(UInt32, String) WriteUInt32(UInt32, String) WriteUInt32(UInt32, String)

When overridden in a derived class, writes a 32-bit unsigned integer to the stream already attached to the formatter.

WriteUInt64(UInt64, String) WriteUInt64(UInt64, String) WriteUInt64(UInt64, String) WriteUInt64(UInt64, String)

When overridden in a derived class, writes a 64-bit unsigned integer to the stream already attached to the formatter.

WriteValueType(Object, String, Type) WriteValueType(Object, String, Type) WriteValueType(Object, String, Type) WriteValueType(Object, String, Type)

When overridden in a derived class, writes a value of the given type to the stream already attached to the formatter.

Applies to

See Also