Formatters

A formatter is an object that knows how to write arbitrary objects to a stream. A formatter exposes this functionality by implementing the IFormatter information from the System.Runtime.Serialization namespace:

Interface IFormatter
  ' Properties
  Property Binder() As SerializationBinder
  Property Context() As StreamingContext
  Property SurrgateSelector() As ISurrogateSelector

  ' Methods
  Function Deserialize(serializationStream As Stream) As Object
  Sub Serialize(serializationStream As Stream, graph As Object)
End Interface

A formatter has two jobs. The first is to serialize arbitrary objects, specifically their fields, including nested objects.[1] The formatter knows which fields to serialize using Reflection,[2] which is the .NET API ...

Get Windows Forms Programming in Visual Basic .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.