XmlSchemaType.IsDerivedFrom Metodo

Definizione

Restituisce un valore che indica se il tipo di schema derivato specificato è derivato dal tipo di schema di base specificato.

public:
 static bool IsDerivedFrom(System::Xml::Schema::XmlSchemaType ^ derivedType, System::Xml::Schema::XmlSchemaType ^ baseType, System::Xml::Schema::XmlSchemaDerivationMethod except);
public static bool IsDerivedFrom (System.Xml.Schema.XmlSchemaType? derivedType, System.Xml.Schema.XmlSchemaType? baseType, System.Xml.Schema.XmlSchemaDerivationMethod except);
public static bool IsDerivedFrom (System.Xml.Schema.XmlSchemaType derivedType, System.Xml.Schema.XmlSchemaType baseType, System.Xml.Schema.XmlSchemaDerivationMethod except);
static member IsDerivedFrom : System.Xml.Schema.XmlSchemaType * System.Xml.Schema.XmlSchemaType * System.Xml.Schema.XmlSchemaDerivationMethod -> bool
Public Shared Function IsDerivedFrom (derivedType As XmlSchemaType, baseType As XmlSchemaType, except As XmlSchemaDerivationMethod) As Boolean

Parametri

derivedType
XmlSchemaType

Classe XmlSchemaType derivata su cui eseguire il test.

baseType
XmlSchemaType

Classe XmlSchemaType di base rispetto al quale eseguire il test della classe XmlSchemaType derivata.

except
XmlSchemaDerivationMethod

Uno dei valori XmlSchemaDerivationMethod che rappresentano un metodo di derivazione dei tipi da escludere dal testing.

Restituisce

true se il tipo derivato è derivato dal tipo di base; in caso contrario, false.

Esempio

Di seguito è riportato un esempio del IsDerivedFrom metodo .

XmlSchemaType xsdInteger = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Integer);  
XmlSchemaType xsdPositiveInteger = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.PositiveInteger);  

// true  
Console.WriteLine(XmlSchemaType.IsDerivedFrom(xsdPositiveInteger, xsdInteger, XmlSchemaDerivationMethod.None));  

// false  
Console.WriteLine(XmlSchemaType.IsDerivedFrom(xsdPositiveInteger, xsdInteger, XmlSchemaDerivationMethod.Restriction));  
Dim xsdInteger As XmlSchemaType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Integer)  
Dim xsdPositiveInteger As XmlSchemaType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.PositiveInteger)  

' True  
Console.WriteLine(XmlSchemaType.IsDerivedFrom(xsdPositiveInteger, xsdInteger, XmlSchemaDerivationMethod.None))  

' False  
Console.WriteLine(XmlSchemaType.IsDerivedFrom(xsdPositiveInteger, xsdInteger, XmlSchemaDerivationMethod.Restriction))  

Si applica a