Formatter 类
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.
重要
此 API 不符合 CLS。
提供公共语言运行时序列化格式化程序的基本功能。
public ref class Formatter abstract : System::Runtime::Serialization::IFormatter
[System.CLSCompliant(false)]
public abstract class Formatter : System.Runtime.Serialization.IFormatter
[System.CLSCompliant(false)]
[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 abstract class Formatter : System.Runtime.Serialization.IFormatter
[System.CLSCompliant(false)]
[System.Serializable]
public abstract class Formatter : System.Runtime.Serialization.IFormatter
[System.CLSCompliant(false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Formatter : System.Runtime.Serialization.IFormatter
[<System.CLSCompliant(false)>]
type Formatter = class
interface IFormatter
[<System.CLSCompliant(false)>]
[<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 Formatter = class
interface IFormatter
[<System.CLSCompliant(false)>]
[<System.Serializable>]
type Formatter = class
interface IFormatter
[<System.CLSCompliant(false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Formatter = class
interface IFormatter
Public MustInherit Class Formatter
Implements IFormatter
- 继承
-
Formatter
- 属性
- 实现
Formatter
abstract
是所有运行时序列化格式化程序的基类,并提供一些用于实现 接口的IFormatter帮助程序方法。
Formatter还管理序列化的队列对象,并基于每个对象生成 ID。
从 Formatter继承时,必须重写以下成员:
Formatter() |
已过时.
初始化 Formatter 类的新实例。 |
m_id |
已过时.
包含与当前格式化程序一起使用的 ObjectIDGenerator。 |
m_object |
已过时.
包含要序列化的对象的 Queue。 |
Binder |
已过时.
当在派生类中重写时,获取或设置与当前格式化程序一起使用的 SerializationBinder。 |
Context |
已过时.
当在派生类中重写时,获取或设置用于当前序列化的 StreamingContext。 |
Surrogate |
已过时.
当在派生类中重写时,获取或设置与当前格式化程序一起使用的 ISurrogateSelector。 |
Deserialize(Stream) |
已过时.
当在派生类中重写时,将连接到格式化程序的流反序列化(在创建该流时),以创建与最初序列化为该流的图形相同的对象图形。 |
Equals(Object) |
已过时.
确定指定对象是否等于当前对象。 (继承自 Object) |
Get |
已过时.
作为默认哈希函数。 (继承自 Object) |
Get |
已过时.
从格式化程序的内部工作队列返回下一个要序列化的对象。 |
Get |
已过时.
获取当前实例的 Type。 (继承自 Object) |
Memberwise |
已过时.
创建当前 Object 的浅表副本。 (继承自 Object) |
Schedule(Object) |
已过时.
安排对象在稍后进行序列化。 |
Serialize(Stream, Object) |
已过时.
当在派生类中重写时,将具有指定根的对象图形序列化为已经连接到格式化程序的流。 |
To |
已过时.
返回表示当前对象的字符串。 (继承自 Object) |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个数组。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 Boolean 值。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 8 位无符号整数。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 Unicode 字符。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 DateTime 值。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 Decimal 值。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个双精度浮点数字。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 16 位有符号整数。 |
Write |
已过时.
当在派生类中重写时,向流中写入一个 32 位有符号整数。 |
Write |
已过时.
当在派生类中重写时,向流中写入一个 64 位有符号整数。 |
Write |
已过时.
检查所接收的数据的类型,并调用相应的 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个对象引用。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 8 位有符号整数。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个单精度浮点数字。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 TimeSpan 值。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 16 位无符号整数。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 32 位无符号整数。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入一个 64 位无符号整数。 |
Write |
已过时.
当在派生类中重写时,向已经连接到格式化程序的流中写入给定类型的值。 |
产品 | 版本 (已过时) |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8 (package-provided), 8, 9 (package-provided), 9) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |