XsdDataContractImporter.Import 메서드

정의

CLR 코드를 생성하는 데 사용된 CodeCompileUnit으로 XML 스키마 집합을 변형합니다.

오버로드

Import(XmlSchemaSet)

XmlSchemaSet에 포함된 지정된 XML 스키마 집합을 CodeCompileUnit으로 변환합니다.

Import(XmlSchemaSet, ICollection<XmlQualifiedName>)

XmlSchemaSet에서 지정한 스키마 형식 집합을, CodeCompileUnit으로 생성된 CLR 형식으로 변환합니다.

Import(XmlSchemaSet, XmlSchemaElement)

지정한 XML 스키마 집합에서 지정한 스키마 요소를 CodeCompileUnit으로 변형하고, 지정한 요소의 데이터 계약 이름을 나타내는 XmlQualifiedName을 반환합니다.

Import(XmlSchemaSet, XmlQualifiedName)

XmlSchemaSet에서 지정한 XML 스키마 형식을 CodeCompileUnit으로 변형합니다.

Import(XmlSchemaSet)

XmlSchemaSet에 포함된 지정된 XML 스키마 집합을 CodeCompileUnit으로 변환합니다.

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)

매개 변수

schemas
XmlSchemaSet

CLR 형식을 생성할 스키마 표현을 포함하는 XmlSchemaSet입니다.

예외

schemas 매개 변수가 null인 경우

예제

다음 예제에서는 CanImport 메서드를 사용하여 스키마 집합을 가져올 수 있는지 여부를 테스트합니다. CanImport 메서드가 true를 반환할 경우 이 코드는 Import 메서드를 호출합니다.

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

적용 대상

Import(XmlSchemaSet, ICollection<XmlQualifiedName>)

XmlSchemaSet에서 지정한 스키마 형식 집합을, CodeCompileUnit으로 생성된 CLR 형식으로 변환합니다.

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

매개 변수

schemas
XmlSchemaSet

스키마 표현을 포함하는 XmlSchemaSet입니다.

typeNames
ICollection<XmlQualifiedName>

가져올 스키마 형식 집합을 나타내는 XmlQualifiedNameICollection<T>입니다.

적용 대상

Import(XmlSchemaSet, XmlSchemaElement)

지정한 XML 스키마 집합에서 지정한 스키마 요소를 CodeCompileUnit으로 변형하고, 지정한 요소의 데이터 계약 이름을 나타내는 XmlQualifiedName을 반환합니다.

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

매개 변수

schemas
XmlSchemaSet

변형할 스키마를 포함하는 XmlSchemaSet입니다.

element
XmlSchemaElement

변형할 특정 스키마 요소를 나타내는 XmlSchemaElement입니다.

반환

XmlQualifiedName

지정한 요소를 나타내는 XmlQualifiedName입니다.

예외

schemas 또는 element 매개 변수가 null인 경우

적용 대상

Import(XmlSchemaSet, XmlQualifiedName)

XmlSchemaSet에서 지정한 XML 스키마 형식을 CodeCompileUnit으로 변형합니다.

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)

매개 변수

schemas
XmlSchemaSet

스키마 표현을 포함하는 XmlSchemaSet입니다.

typeName
XmlQualifiedName

가져올 특정 스키마 형식을 나타내는 XmlQualifiedName 입니다.

예외

schemas 또는 typeName 매개 변수가 null인 경우

적용 대상