FormatterTypeStyle FormatterTypeStyle FormatterTypeStyle FormatterTypeStyle Enum

定义

指示类型说明在序列化流中的布局格式。Indicates the format in which type descriptions are laid out in the serialized stream.

public enum class FormatterTypeStyle
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum FormatterTypeStyle
type FormatterTypeStyle = 
Public Enum FormatterTypeStyle
继承
FormatterTypeStyleFormatterTypeStyleFormatterTypeStyleFormatterTypeStyle
属性

字段

TypesAlways TypesAlways TypesAlways TypesAlways 1

指示类型可以提供给所有对象成员和 ISerializable 对象成员。Indicates that types can be given to all object members and ISerializable object members.

TypesWhenNeeded TypesWhenNeeded TypesWhenNeeded TypesWhenNeeded 0

指示只能为对象数组、Object 类型的对象成员和 ISerializable 非基元值类型声明类型。Indicates that types can be stated only for arrays of objects, object members of type Object, and ISerializable non-primitive value types.

XsdString XsdString XsdString XsdString 2

指示可以采用 XSD 格式(而不是 SOAP 格式)来提供字符串。Indicates that strings can be given in the XSD format rather than SOAP. 不传输任何字符串 ID。No string IDs are transmitted.

注解

XsdStringTypesWhenNeeded设置适用于高性能基于 particular.NET 实现的相同版本的服务之间的序列化。The XsdString and TypesWhenNeeded settings are meant for high performance serialization between services built on the same version of a particular.NET implementation. 不支持这两个值VTS (版本容错序列化)因为它们有意省略 VTS 用来跳过或添加可选字段和属性的类型信息。These two values do not support VTS (Version Tolerant Serialization) because they intentionally omit type information that VTS uses to skip or add optional fields and properties. 不应使用XsdStringTypesWhenNeeded键入格式序列化和反序列化类型运行不同版本的.NET 实现,而不序列化类型的计算机的计算机上时。You should not use the XsdString or TypesWhenNeeded type formats when serializing and deserializing types on a computer running a different version of the .NET implementation than the computer on which the type was serialized. 序列化和反序列化计算机运行不同版本的.NET 实现上会导致要跳过的类型信息,从而使得反序列化程序无法跳过可选字段,如果它们不在序列化的格式化程序另一个版本的.NET 实现中可能存在某些类型。Serializing and deserializing on computers running different versions of a .NET implementation causes the formatter to skip serialization of type information, thus making it impossible for the deserializer to skip optional fields if they are not present in certain types that may exist in the other version of the .NET implementation. 如果必须使用XsdStringTypesWhenNeeded必须在此类方案中,提供有关已从一个版本更改为其他类型的自定义序列化。If you must use XsdString or TypesWhenNeeded in such a scenario, you must provide custom serialization for types that have changed from one version to the other.

适用于