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. 當序列化和還原序列化執行不同 .NET 版本的電腦上的型別時,不應該使用 XsdStringTypesWhenNeeded 類型格式,而不是序列化該類型的電腦。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.

適用於