FormatterTypeStyle 枚举

定义

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

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

字段

TypesAlways 1

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

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 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. XsdString TypesWhenNeeded 运行不同版本的 .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. 如果在 XsdString TypesWhenNeeded 这种情况下必须使用或,则必须为从一个版本更改到另一个版本的类型提供自定义序列化。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.

适用于