CodeGenerationOptions 列舉
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定在產生 .NET 類型以便搭配 XML Web Service 使用時要使用的各種選項。
此列舉支援其成員值的位元組合。
public enum class CodeGenerationOptions
C#
[System.Flags]
public enum CodeGenerationOptions
[<System.Flags>]
type CodeGenerationOptions =
Public Enum CodeGenerationOptions
- 繼承
- 屬性
名稱 | 值 | Description |
---|---|---|
EnableDataBinding | 16 | 啟用資料繫結。 |
GenerateNewAsync | 2 | 為 Web 方法的非同步引動過程建立事件。 |
GenerateOldAsync | 4 | 為 Web 方法的非同步引動過程建立 Begin 和 End 方法。 |
GenerateOrder | 8 | 產生明確排序的序列化程式碼,如同透過 XmlAnyElementAttribute、XmlArrayAttribute 和 XmlElementAttribute 屬性 (Attribute) 的 |
GenerateProperties | 1 | 按照屬性表示基本類型。 |
None | 0 | 以欄位和 System 命名空間類型來表示基本類型。 |
下列範例說明如何使用 CodeGenerationOptions
列舉來指定 對象的行為 ServiceDescriptionImporter 。
// Generate properties to represent primitive values.
importer->CodeGenerationOptions = System::Xml::Serialization::CodeGenerationOptions::GenerateProperties;
C#
// Generate properties to represent primitive values.
importer.CodeGenerationOptions = System.Xml.Serialization.CodeGenerationOptions.GenerateProperties;
如需此 API 的詳細資訊,請參閱 CodeGenerationOptions 的補充 API 備註。
產品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 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 |