XsdDataContractExporter.CanExport 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
CLR(공용 언어 런타임) 형식(또는 형식 집합)을 내보낼 수 있는지 여부를 나타내는 값을 가져옵니다.
오버로드
| Name | Description |
|---|---|
| CanExport(ICollection<Assembly>) |
어셈블리 집합에 포함된 .CLR(공용 언어 런타임) 형식 집합을 내보낼 수 있는지 여부를 나타내는 값을 가져옵니다. |
| CanExport(ICollection<Type>) |
에 포함된 ICollection<T> .CLR(공용 언어 런타임) 형식 집합을 내보낼 수 있는지 여부를 나타내는 값을 가져옵니다. |
| CanExport(Type) |
지정된 CLR(공용 언어 런타임) 형식을 내보낼 수 있는지 여부를 나타내는 값을 가져옵니다. |
설명
데이터 계약에서 모든 CLR 형식을 사용할 수 있는 것은 아닙니다. serialize할 수 있는 항목에 대한 자세한 내용은 데이터 계약 직렬 변환기에서 지원하는 형식을 참조하세요.
CanExport(ICollection<Assembly>)
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
어셈블리 집합에 포함된 .CLR(공용 언어 런타임) 형식 집합을 내보낼 수 있는지 여부를 나타내는 값을 가져옵니다.
public:
bool CanExport(System::Collections::Generic::ICollection<System::Reflection::Assembly ^> ^ assemblies);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[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 bool CanExport(System.Collections.Generic.ICollection<System.Reflection.Assembly> assemblies);
public bool CanExport(System.Collections.Generic.ICollection<System.Reflection.Assembly> assemblies);
[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 bool CanExport(System.Collections.Generic.ICollection<System.Reflection.Assembly> assemblies);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<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.CanExport : System.Collections.Generic.ICollection<System.Reflection.Assembly> -> bool
member this.CanExport : System.Collections.Generic.ICollection<System.Reflection.Assembly> -> bool
[<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.CanExport : System.Collections.Generic.ICollection<System.Reflection.Assembly> -> bool
Public Function CanExport (assemblies As ICollection(Of Assembly)) As Boolean
매개 변수
- assemblies
- ICollection<Assembly>
그 중 ICollection<T> A Assembly 에는 내보낼 형식이 있는 어셈블리가 포함됩니다.
반품
- 특성
적용 대상
CanExport(ICollection<Type>)
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
에 포함된 ICollection<T> .CLR(공용 언어 런타임) 형식 집합을 내보낼 수 있는지 여부를 나타내는 값을 가져옵니다.
public:
bool CanExport(System::Collections::Generic::ICollection<Type ^> ^ types);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[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 bool CanExport(System.Collections.Generic.ICollection<Type> types);
public bool CanExport(System.Collections.Generic.ICollection<Type> types);
[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 bool CanExport(System.Collections.Generic.ICollection<Type> types);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<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.CanExport : System.Collections.Generic.ICollection<Type> -> bool
member this.CanExport : System.Collections.Generic.ICollection<Type> -> bool
[<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.CanExport : System.Collections.Generic.ICollection<Type> -> bool
Public Function CanExport (types As ICollection(Of Type)) As Boolean
매개 변수
- types
- ICollection<Type>
내보낼 지정된 형식을 포함하는 A ICollection<T> 입니다.
반품
- 특성
적용 대상
CanExport(Type)
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
- Source:
- XsdDataContractExporter.cs
지정된 CLR(공용 언어 런타임) 형식을 내보낼 수 있는지 여부를 나타내는 값을 가져옵니다.
public:
bool CanExport(Type ^ type);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[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 bool CanExport(Type type);
public bool CanExport(Type type);
[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 bool CanExport(Type type);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<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.CanExport : Type -> bool
member this.CanExport : Type -> bool
[<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.CanExport : Type -> bool
Public Function CanExport (type As Type) As Boolean
매개 변수
반품
true형식을 내보낼 수 있으면 이고, 그렇지 않으면 . false
- 특성
예제
다음 예제에서는 메서드를 CanExport(Type) 호출하기 전에 메서드를 호출합니다 Export(Type) .
static void ExportXSD()
{
XsdDataContractExporter exporter = new XsdDataContractExporter();
if (exporter.CanExport(typeof(Employee)))
{
exporter.Export(typeof(Employee));
Console.WriteLine("number of schemas: {0}", exporter.Schemas.Count);
Console.WriteLine();
XmlSchemaSet mySchemas = exporter.Schemas;
XmlQualifiedName XmlNameValue = exporter.GetRootElementName(typeof(Employee));
string EmployeeNameSpace = XmlNameValue.Namespace;
foreach (XmlSchema schema in mySchemas.Schemas(EmployeeNameSpace))
{
schema.Write(Console.Out);
}
}
}
Shared Sub ExportXSD()
Dim exporter As New XsdDataContractExporter()
' Use the ExportOptions to add the Possessions type to the
' collection of KnownTypes.
Dim eOptions As New ExportOptions()
eOptions.KnownTypes.Add(GetType(Possessions))
exporter.Options = eOptions
If exporter.CanExport(GetType(Employee)) Then
exporter.Export(GetType(Employee))
Console.WriteLine("number of schemas: {0}", exporter.Schemas.Count)
Console.WriteLine()
Dim mySchemas As XmlSchemaSet = exporter.Schemas
Dim XmlNameValue As XmlQualifiedName = _
exporter.GetRootElementName(GetType(Employee))
Dim EmployeeNameSpace As String = XmlNameValue.Namespace
Dim schema As XmlSchema
For Each schema In mySchemas.Schemas(EmployeeNameSpace)
schema.Write(Console.Out)
Next schema
End If
End Sub