Redigera

Dela via


XsdDataContractImporter.GetCodeTypeReference Method

Definition

Returns a CodeTypeReference for the specified element.

Overloads

GetCodeTypeReference(XmlQualifiedName)

Returns a CodeTypeReference to the CLR type generated for the schema type with the specified XmlQualifiedName.

GetCodeTypeReference(XmlQualifiedName, XmlSchemaElement)

Returns a CodeTypeReference for the specified XML qualified element and schema element.

GetCodeTypeReference(XmlQualifiedName)

Source:
XsdDataContractImporter.cs
Source:
XsdDataContractImporter.cs
Source:
XsdDataContractImporter.cs

Returns a CodeTypeReference to the CLR type generated for the schema type with the specified XmlQualifiedName.

public:
 System::CodeDom::CodeTypeReference ^ GetCodeTypeReference(System::Xml::XmlQualifiedName ^ typeName);
public System.CodeDom.CodeTypeReference GetCodeTypeReference (System.Xml.XmlQualifiedName typeName);
member this.GetCodeTypeReference : System.Xml.XmlQualifiedName -> System.CodeDom.CodeTypeReference
Public Function GetCodeTypeReference (typeName As XmlQualifiedName) As CodeTypeReference

Parameters

typeName
XmlQualifiedName

The XmlQualifiedName that specifies the schema type to look up.

Returns

A CodeTypeReference reference to the CLR type generated for the schema type with the typeName specified.

Remarks

Use this method to look up the reference to a generated CLR type after calling the Import method. The CodeTypeReference contains the name of the generated type and can be used to look up the corresponding CodeTypeDeclaration in the CodeCompileUnit.

Applies to

GetCodeTypeReference(XmlQualifiedName, XmlSchemaElement)

Source:
XsdDataContractImporter.cs
Source:
XsdDataContractImporter.cs
Source:
XsdDataContractImporter.cs

Returns a CodeTypeReference for the specified XML qualified element and schema element.

public:
 System::CodeDom::CodeTypeReference ^ GetCodeTypeReference(System::Xml::XmlQualifiedName ^ typeName, System::Xml::Schema::XmlSchemaElement ^ element);
public System.CodeDom.CodeTypeReference GetCodeTypeReference (System.Xml.XmlQualifiedName typeName, System.Xml.Schema.XmlSchemaElement element);
member this.GetCodeTypeReference : System.Xml.XmlQualifiedName * System.Xml.Schema.XmlSchemaElement -> System.CodeDom.CodeTypeReference
Public Function GetCodeTypeReference (typeName As XmlQualifiedName, element As XmlSchemaElement) As CodeTypeReference

Parameters

typeName
XmlQualifiedName

An XmlQualifiedName that specifies the XML qualified name of the schema type to look up.

element
XmlSchemaElement

An XmlSchemaElement that specifies an element in an XML schema.

Returns

A CodeTypeReference that represents the type that was generated for the specified schema type.

Remarks

The schema element is needed for data about the type that is specified at the element scope. The main example of this is the XSD attribute nillable. In schema, setting nillable to true is specified on the containing schema element whereas the concept of null is expressed in the CLR type Nullable<T>. The element is passed in so that this importer can look up the element-level information and return the correct type reference accordingly.

When importing WSDL, each parameter is imported separately and therefore the parameter elements need to be passed in separately.

Applies to