Język

XsdDataContractExporter.GetSchemaType(Type) Metoda

Definicja

Zwraca typ schematu XML dla określonego typu.

public:
 System::Xml::Schema::XmlSchemaType ^ GetSchemaType(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 System.Xml.Schema.XmlSchemaType? GetSchemaType(Type type);
public System.Xml.Schema.XmlSchemaType? GetSchemaType(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 System.Xml.Schema.XmlSchemaType? GetSchemaType(Type type);
public System.Xml.Schema.XmlSchemaType GetSchemaType(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.GetSchemaType : Type -> System.Xml.Schema.XmlSchemaType
member this.GetSchemaType : Type -> System.Xml.Schema.XmlSchemaType
[<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.GetSchemaType : Type -> System.Xml.Schema.XmlSchemaType
Public Function GetSchemaType (type As Type) As XmlSchemaType

Parametry

type
Type

Typ, dla których ma być zwracany schemat.

Zwraca

Element XmlSchemaType zawierający schemat XML.

Atrybuty

Wyjątki

Argumentem type jest null.

Uwagi

Głównym celem tej metody jest umożliwienie reprezentowania typów anonimowych w schemacie XML. Ponieważ typy anonimowe nie mają nazwy kontraktu i przestrzeni nazw, nie można ich wyszukać przy użyciu .GetSchemaTypeName Ta metoda zwraca definicję XmlSchemaType dla takich typów. Typy, dla których GetSchemaTypeName metoda zwraca prawidłową nazwę, ta metoda zwraca wartość null.

Dotyczy