System.Xml.Serialization.CodeGenerationOptions Enumeration

Specifies various options to use when generating .NET Framework types for use with an XML Web Service.

Syntax

[System.Flags]
public enum CodeGenerationOptions

Remarks

A Web Service Description Language (WSDL) file typically describes a class in XML schema language as an xsd:complex type composed of various primitive xsd:complex and xsd:simple types. When generating a .NET Framework class that represents a given xsd:complex type, you must choose how to represent the various primitive types it contains.

By default, each primitive is implemented as a field. If you specify the CodeGenerationOptions.GenerateProperties option, each primitive type is instead implemented as a property.

Ordering of Serialization Code

The CodeGenerationOptions.GenerateOrder member instructs the code generator to create the serialization code in a specific order as determined by the Order property of the following attributes:

T:System.Xml.Serialization.XmlAnyElementAttribute T:System.Xml.Serialization.XmlArrayAttribute T:System.Xml.Serialization.XmlElementAttribute

Note:

Once the Order property has been set on one public property or field in a type, it must be applied to all public properties and fields for that type and all inherited types.

Members

Member NameDescription
EnableDataBinding

Enables data binding.

GenerateNewAsync

Creates events for the asynchronous invocation of Web methods.

GenerateOldAsync

Creates Begin and End methods for the asynchronous invocation of Web methods.

GenerateOrder

Generates explicitly ordered serialization code as specified through the Order property of the System.Xml.Serialization.XmlAnyElementAttribute, System.Xml.Serialization.XmlArrayAttribute, and System.Xml.Serialization.XmlElementAttribute attributes.

GenerateProperties

Represents primitive types by properties.

None

Represents primitive types by fields and primitive types by System namespace types.

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0