System.Xml.Serialization.Advanced.SchemaImporterExtension.ImportSchemaType Method

Allows you to manipulate the code generated by examining the imported schema and specifying the CLR type that it maps to.

Syntax

public virtual string ImportSchemaType (string name, string ns, System.Xml.Schema.XmlSchemaObject context, System.Xml.Serialization.XmlSchemas schemas, System.Xml.Serialization.XmlSchemaImporter importer, System.CodeDom.CodeCompileUnit compileUnit, System.CodeDom.CodeNamespace mainNamespace, System.Xml.Serialization.CodeGenerationOptions options, System.CodeDom.Compiler.CodeDomProvider codeProvider)

Parameters

name
The name of the element.
ns
The namespace of the element.
context
An System.Xml.Schema.XmlSchemaObject that represents schema information, such as the line number of the XML element.
schemas
An System.Xml.Serialization.XmlSchemas that contains the collection of schemas in the document.
importer
The System.Xml.Serialization.XmlSchemaImporter that is the importer being used.
compileUnit
A System.CodeDom.CodeCompileUnit to which you can add CodeDOM structures to generate alternative code for the XSD.
mainNamespace
A System.CodeDom.CodeNamespace that represents the current namespace for the element.
options
A System.Xml.Serialization.CodeGenerationOptions for the setting options on the code compiler.
codeProvider
A System.CodeDom.Compiler.CodeDomProvider that is used to generate the new code.

Returns

The name of the CLR type that this maps to.

Remarks

In order to control the generation of the code, you must use the classes found in the System.CodeDom namespace. For more information, see Using the CodeDOM and CodeDOM Quick Reference.

Requirements

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