XsdDataContractImporter.Import 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
XML 스키마 집합을 CLR 코드를 생성하는 데 사용되는 스키마로 CodeCompileUnit 변환합니다.
오버로드
| Name | Description |
|---|---|
| Import(XmlSchemaSet) |
에 포함된 XmlSchemaSet 지정된 XML 스키마 집합을 으로 CodeCompileUnit변환합니다. |
| Import(XmlSchemaSet, ICollection<XmlQualifiedName>) |
에 포함된 지정된 스키마 형식 집합을 XmlSchemaSet 생성된 CLR 형식으로 CodeCompileUnit변환합니다. |
| Import(XmlSchemaSet, XmlSchemaElement) |
지정된 XML 스키마 집합의 지정된 스키마 요소를 a CodeCompileUnit 로 변환하고 지정된 요소의 데이터 계약 이름을 나타내는 스키마를 반환 XmlQualifiedName 합니다. |
| Import(XmlSchemaSet, XmlQualifiedName) |
에 포함된 지정된 XML 스키마 형식을 XmlSchemaSetCodeCompileUnit.로 변환합니다. |
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 형식을 생성할 스키마 표현을 포함하는 A 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 생성된 CLR 형식으로 CodeCompileUnit변환합니다.
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
스키마 표현을 포함하는 A XmlSchemaSet 입니다.
- typeNames
- ICollection<XmlQualifiedName>
가져올 스키마 형식 집합입니다.
적용 대상
Import(XmlSchemaSet, XmlSchemaElement)
지정된 XML 스키마 집합의 지정된 스키마 요소를 a 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 지정된 요소를 나타내는 값입니다.
예외
schemas 또는 element 매개 변수가 .입니다null.
적용 대상
Import(XmlSchemaSet, XmlQualifiedName)
에 포함된 지정된 XML 스키마 형식을 XmlSchemaSetCodeCompileUnit.로 변환합니다.
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
스키마 표현을 포함하는 A XmlSchemaSet 입니다.
- typeName
- XmlQualifiedName
XmlQualifiedName 가져올 특정 스키마 형식을 나타내는 A입니다.
예외
schemas 또는 typeName 매개 변수가 .입니다null.