FormatterTypeStyle 列舉

定義

警告

Formatter-based serialization is obsolete and should not be used.

指示用來在序列化資料流中配置型別描述的格式。

public enum class FormatterTypeStyle
public enum FormatterTypeStyle
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum FormatterTypeStyle
[System.Serializable]
public enum FormatterTypeStyle
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormatterTypeStyle
type FormatterTypeStyle = 
[<System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type FormatterTypeStyle = 
[<System.Serializable>]
type FormatterTypeStyle = 
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type FormatterTypeStyle = 
Public Enum FormatterTypeStyle
繼承
FormatterTypeStyle
屬性

欄位

TypesAlways 1

指示型別可以提供給所有的物件成員和 ISerializable 物件成員。

TypesWhenNeeded 0

指示型別只可以為物件之陣列、型別 Object 之物件成員和 ISerializable 非基本實值型別的陳述。

XsdString 2

指示將字串提供為 XSD 格式,而不是 SOAP 格式。 不會傳送字串 ID。

備註

XsdStringTypesWhenNeeded 設定是為了在建置在相同版本的 particular.NET 實作上建置的服務之間進行高效能序列化。 這兩個值不支援 VTS (版本容錯序列化) ,因為它們刻意省略 VTS 用來略過或新增選擇性欄位和屬性的類型資訊。 在執行不同 .NET 實作版本的電腦上序列化和還原序列化類型時,您不應該使用 XsdStringTypesWhenNeeded 型別格式,而不是序列化類型的電腦。 在執行不同 .NET 實作版本的電腦上序列化和還原序列化會導致格式器略過類型資訊的序列化,因此如果還原序列化程式不存在於其他 .NET 實作版本中,就無法略過選擇性欄位。 如果您必須使用 XsdStringTypesWhenNeeded 在這種情況下,您必須為已從某個版本變更為另一個版本的類型提供自訂序列化。

適用於