XsdDataContractImporter.CanImport Method (XmlSchemaSet, XmlSchemaElement)

 

Gets a value that indicates whether a specific schema element contained in an XmlSchemaSet can be imported.

Namespace:   System.Runtime.Serialization
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

public bool CanImport(
	XmlSchemaSet schemas,
	XmlSchemaElement element
)

Parameters

schemas
Type: System.Xml.Schema.XmlSchemaSet

An XmlSchemaSet to import.

element
Type: System.Xml.Schema.XmlSchemaElement

A specific XmlSchemaElement to check in the set of schemas.

Return Value

Type: System.Boolean

true if the element can be imported; otherwise, false.

Exception Condition
ArgumentNullException

The schemas or element parameter is null.

InvalidDataContractException

A data contract involved in the import is invalid.

This method checks the type and all schema types referenced from it.

.NET Framework
Available since 3.0
Return to top
Show: