XsdDataContractImporter.Import Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Transforma um conjunto de esquemas XML em um CodeCompileUnit usado para gerar código CLR.
Sobrecargas
| Nome | Description |
|---|---|
| Import(XmlSchemaSet) |
Transforma o conjunto especificado de esquemas XML contidos em um XmlSchemaSetCodeCompileUnit. |
| Import(XmlSchemaSet, ICollection<XmlQualifiedName>) |
Transforma o conjunto especificado de tipos de esquema contidos em um XmlSchemaSet tipo CLR gerado em um CodeCompileUnit. |
| Import(XmlSchemaSet, XmlSchemaElement) |
Transforma o elemento de esquema especificado no conjunto de esquemas XML especificados em um CodeCompileUnit e retorna um XmlQualifiedName que representa o nome do contrato de dados para o elemento especificado. |
| Import(XmlSchemaSet, XmlQualifiedName) |
Transforma o tipo de esquema XML especificado contido em um XmlSchemaSetCodeCompileUnit. |
Import(XmlSchemaSet)
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
Transforma o conjunto especificado de esquemas XML contidos em um XmlSchemaSetCodeCompileUnit.
public:
void Import(System::Xml::Schema::XmlSchemaSet ^ schemas);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public void Import(System.Xml.Schema.XmlSchemaSet schemas);
public void Import(System.Xml.Schema.XmlSchemaSet schemas);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
member this.Import : System.Xml.Schema.XmlSchemaSet -> unit
member this.Import : System.Xml.Schema.XmlSchemaSet -> unit
Public Sub Import (schemas As XmlSchemaSet)
Parâmetros
- schemas
- XmlSchemaSet
Um XmlSchemaSet que contém as representações de esquema para as quais gerar tipos CLR.
- Atributos
Exceções
O schemas parâmetro é null.
Exemplos
O exemplo a seguir usa o CanImport método para testar se um conjunto de esquemas pode ser importado. Se o CanImport método retornar true, o código invocará o Import método.
static CodeCompileUnit Import(XmlSchemaSet schemas)
{
XsdDataContractImporter imp = new XsdDataContractImporter();
// The EnableDataBinding option adds a RaisePropertyChanged method to
// the generated code. The GenerateInternal causes code access to be
// set to internal.
ImportOptions iOptions = new ImportOptions();
iOptions.EnableDataBinding = true;
iOptions.GenerateInternal = true;
imp.Options = iOptions;
if (imp.CanImport(schemas))
{
imp.Import(schemas);
return imp.CodeCompileUnit;
}
else
{
return null;
}
}
Shared Function Import(ByVal schemas As XmlSchemaSet) As CodeCompileUnit
Dim imp As New XsdDataContractImporter()
' The EnableDataBinding option adds a RaisePropertyChanged method to
' the generated code. The GenerateInternal causes code access to be
' set to internal.
Dim iOptions As New ImportOptions()
iOptions.EnableDataBinding = true
iOptions.GenerateInternal = true
imp.Options = IOptions
If imp.CanImport(schemas) Then
imp.Import(schemas)
Return imp.CodeCompileUnit
Else
Return Nothing
End If
End Function
Aplica-se a
Import(XmlSchemaSet, ICollection<XmlQualifiedName>)
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
Transforma o conjunto especificado de tipos de esquema contidos em um XmlSchemaSet tipo CLR gerado em um CodeCompileUnit.
public:
void Import(System::Xml::Schema::XmlSchemaSet ^ schemas, System::Collections::Generic::ICollection<System::Xml::XmlQualifiedName ^> ^ typeNames);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public void Import(System.Xml.Schema.XmlSchemaSet schemas, System.Collections.Generic.ICollection<System.Xml.XmlQualifiedName> typeNames);
public void Import(System.Xml.Schema.XmlSchemaSet schemas, System.Collections.Generic.ICollection<System.Xml.XmlQualifiedName> typeNames);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
member this.Import : System.Xml.Schema.XmlSchemaSet * System.Collections.Generic.ICollection<System.Xml.XmlQualifiedName> -> unit
member this.Import : System.Xml.Schema.XmlSchemaSet * System.Collections.Generic.ICollection<System.Xml.XmlQualifiedName> -> unit
Public Sub Import (schemas As XmlSchemaSet, typeNames As ICollection(Of XmlQualifiedName))
Parâmetros
- schemas
- XmlSchemaSet
Um XmlSchemaSet que contém as representações de esquema.
- typeNames
- ICollection<XmlQualifiedName>
O conjunto de tipos de esquema a serem importados.
- Atributos
Aplica-se a
Import(XmlSchemaSet, XmlSchemaElement)
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
Transforma o elemento de esquema especificado no conjunto de esquemas XML especificados em um CodeCompileUnit e retorna um XmlQualifiedName que representa o nome do contrato de dados para o elemento especificado.
public:
System::Xml::XmlQualifiedName ^ Import(System::Xml::Schema::XmlSchemaSet ^ schemas, System::Xml::Schema::XmlSchemaElement ^ element);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public System.Xml.XmlQualifiedName? Import(System.Xml.Schema.XmlSchemaSet schemas, System.Xml.Schema.XmlSchemaElement element);
public System.Xml.XmlQualifiedName Import(System.Xml.Schema.XmlSchemaSet schemas, System.Xml.Schema.XmlSchemaElement element);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
member this.Import : System.Xml.Schema.XmlSchemaSet * System.Xml.Schema.XmlSchemaElement -> System.Xml.XmlQualifiedName
member this.Import : System.Xml.Schema.XmlSchemaSet * System.Xml.Schema.XmlSchemaElement -> System.Xml.XmlQualifiedName
Public Function Import (schemas As XmlSchemaSet, element As XmlSchemaElement) As XmlQualifiedName
Parâmetros
- schemas
- XmlSchemaSet
Um XmlSchemaSet que contém os esquemas a serem transformados.
- element
- XmlSchemaElement
Um XmlSchemaElement que representa o elemento de esquema específico a ser transformado.
Retornos
Um XmlQualifiedName que representa o elemento especificado.
- Atributos
Exceções
O schemas parâmetro ou element o parâmetro é null.
Aplica-se a
Import(XmlSchemaSet, XmlQualifiedName)
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
- Origem:
- XsdDataContractImporter.cs
Transforma o tipo de esquema XML especificado contido em um XmlSchemaSetCodeCompileUnit.
public:
void Import(System::Xml::Schema::XmlSchemaSet ^ schemas, System::Xml::XmlQualifiedName ^ typeName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public void Import(System.Xml.Schema.XmlSchemaSet schemas, System.Xml.XmlQualifiedName typeName);
public void Import(System.Xml.Schema.XmlSchemaSet schemas, System.Xml.XmlQualifiedName typeName);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
member this.Import : System.Xml.Schema.XmlSchemaSet * System.Xml.XmlQualifiedName -> unit
member this.Import : System.Xml.Schema.XmlSchemaSet * System.Xml.XmlQualifiedName -> unit
Public Sub Import (schemas As XmlSchemaSet, typeName As XmlQualifiedName)
Parâmetros
- schemas
- XmlSchemaSet
Um XmlSchemaSet que contém as representações de esquema.
- typeName
- XmlQualifiedName
Um XmlQualifiedName que representa um tipo de esquema específico a ser importado.
- Atributos
Exceções
O schemas parâmetro ou typeName o parâmetro é null.