XsdDataContractImporter.Import Yöntem

Tanım

BIR XML şemaları kümesini CLR kodu oluşturmak için kullanılan bir CodeCompileUnit şemaya dönüştürür.

Aşırı Yüklemeler

Import(XmlSchemaSet)

içinde bulunan belirtilen XML şema kümesini içine XmlSchemaSetCodeCompileUnitdönüştürür.

Import(XmlSchemaSet, ICollection<XmlQualifiedName>)

içinde bulunan belirtilen şema türleri kümesini, içinde XmlSchemaSet oluşturulan CLR türlerine CodeCompileUnitdönüştürür.

Import(XmlSchemaSet, XmlSchemaElement)

Belirtilen XML şemaları kümesindeki belirtilen şema öğesini öğesine CodeCompileUnit dönüştürür ve belirtilen öğe için veri sözleşmesi adını temsil eden bir XmlQualifiedName döndürür.

Import(XmlSchemaSet, XmlQualifiedName)

içinde bulunan belirtilen XML şema türünü içine XmlSchemaSetCodeCompileUnitdönüştürür.

Import(XmlSchemaSet)

Kaynak:
XsdDataContractImporter.cs
Kaynak:
XsdDataContractImporter.cs

içinde bulunan belirtilen XML şema kümesini içine XmlSchemaSetCodeCompileUnitdönüştürür.

public:
 void Import(System::Xml::Schema::XmlSchemaSet ^ schemas);
public void Import (System.Xml.Schema.XmlSchemaSet schemas);
member this.Import : System.Xml.Schema.XmlSchemaSet -> unit
Public Sub Import (schemas As XmlSchemaSet)

Parametreler

schemas
XmlSchemaSet

XmlSchemaSet CLR türlerinin oluşturulacağı şema gösterimlerini içeren bir.

Özel durumlar

schemas parametresidirnull.

Örnekler

Aşağıdaki örnek, bir şema kümesinin CanImport içeri aktarılıp aktarılamayacağını test etmek için yöntemini kullanır. CanImport yöntemi döndürürse truekod yöntemini çağırırImport.

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

Şunlara uygulanır

Import(XmlSchemaSet, ICollection<XmlQualifiedName>)

Kaynak:
XsdDataContractImporter.cs
Kaynak:
XsdDataContractImporter.cs

içinde bulunan belirtilen şema türleri kümesini, içinde XmlSchemaSet oluşturulan CLR türlerine CodeCompileUnitdönüştürür.

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);
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))

Parametreler

schemas
XmlSchemaSet

XmlSchemaSet Şema gösterimlerini içeren bir.

typeNames
ICollection<XmlQualifiedName>

ICollection<T> İçeri aktaracak şema türleri kümesini temsil eden bir (/ XmlQualifiedName).

Şunlara uygulanır

Import(XmlSchemaSet, XmlSchemaElement)

Kaynak:
XsdDataContractImporter.cs
Kaynak:
XsdDataContractImporter.cs

Belirtilen XML şemaları kümesindeki belirtilen şema öğesini öğesine CodeCompileUnit dönüştürür ve belirtilen öğe için veri sözleşmesi adını temsil eden bir XmlQualifiedName döndürür.

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);
public System.Xml.XmlQualifiedName Import (System.Xml.Schema.XmlSchemaSet schemas, System.Xml.Schema.XmlSchemaElement element);
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

Parametreler

schemas
XmlSchemaSet

XmlSchemaSet Dönüştürülecek şemaları içeren.

element
XmlSchemaElement

XmlSchemaElement Dönüştürülecek belirli şema öğesini temsil eden bir.

Döndürülenler

XmlQualifiedName Belirtilen öğeyi temsil eden bir.

Özel durumlar

schemas veya element parametresidirnull.

Şunlara uygulanır

Import(XmlSchemaSet, XmlQualifiedName)

Kaynak:
XsdDataContractImporter.cs
Kaynak:
XsdDataContractImporter.cs

içinde bulunan belirtilen XML şema türünü içine XmlSchemaSetCodeCompileUnitdönüştürür.

public:
 void Import(System::Xml::Schema::XmlSchemaSet ^ schemas, System::Xml::XmlQualifiedName ^ typeName);
public void Import (System.Xml.Schema.XmlSchemaSet schemas, System.Xml.XmlQualifiedName typeName);
member this.Import : System.Xml.Schema.XmlSchemaSet * System.Xml.XmlQualifiedName -> unit
Public Sub Import (schemas As XmlSchemaSet, typeName As XmlQualifiedName)

Parametreler

schemas
XmlSchemaSet

XmlSchemaSet Şema gösterimlerini içeren bir.

typeName
XmlQualifiedName

XmlQualifiedName İçeri aktaracak belirli bir şema türünü temsil eden bir.

Özel durumlar

schemas veya typeName parametresidirnull.

Şunlara uygulanır