XmlSchemaType.IsDerivedFrom Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne une valeur indiquant si le type de schéma dérivé spécifié est dérivé du type de schéma de base spécifié.
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
Paramètres
- derivedType
- XmlSchemaType
Dérivé XmlSchemaType à tester.
- baseType
- XmlSchemaType
Base XmlSchemaType à laquelle tester le dérivé XmlSchemaType .
- except
- XmlSchemaDerivationMethod
Une des valeurs représentant une méthode de dérivation de XmlSchemaDerivationMethod type à exclure du test.
Retours
true si le type dérivé est dérivé du type de base ; sinon, false.
Exemples
Voici un exemple de méthode IsDerivedFrom .
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))