Movatterモバイル変換


[0]ホーム

URL:


Skip to main contentSkip to in-page navigation

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

IFormatter Interface

Definition

Namespace:
System.Runtime.Serialization
Assemblies:
netstandard.dll, System.Runtime.Serialization.Formatters.dll
Assembly:
System.Runtime.Serialization.Formatters.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Package:
System.Runtime.Serialization.Formatters v10.0.0-rc.1.25451.107
Source:
IFormatter.cs
Source:
IFormatter.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Caution

BinaryFormatter serialization is obsolete and should not be used. Seehttps://aka.ms/binaryformatter for more information.

Provides functionality for formatting serialized objects.

public interface class IFormatter
[System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]public interface IFormatter
public interface IFormatter
[System.Runtime.InteropServices.ComVisible(true)]public interface IFormatter
[<System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]type IFormatter = interface
type IFormatter = interface
[<System.Runtime.InteropServices.ComVisible(true)>]type IFormatter = interface
Public Interface IFormatter
Derived
Attributes

Remarks

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

Objects controlling their own serialization can do so by implementing theISerializable 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. UseSerialize(Stream, Object) to serialize an object or graph of objects. UseDeserialize(Stream) to deserialize a stream and create a clone of the original object or graph of objects.

Properties

Binder

Gets or sets theSerializationBinder that performs type lookups during deserialization.

Context

Gets or sets theStreamingContext used for serialization and deserialization.

SurrogateSelector

Gets or sets theSurrogateSelector used by the current formatter.

Methods

Deserialize(Stream)
Obsolete.

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

Serialize(Stream, Object)
Obsolete.

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

Applies to

See also

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

In this article

Was this page helpful?

YesNo
No

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?