本文整理匯總了C#中System.Xml.Schema.XmlSchemaDatatype.IsDerivedFrom方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlSchemaDatatype.IsDerivedFrom方法的具體用法?C# XmlSchemaDatatype.IsDerivedFrom怎麽用?C# XmlSchemaDatatype.IsDerivedFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Schema.XmlSchemaDatatype
的用法示例。
在下文中一共展示了XmlSchemaDatatype.IsDerivedFrom方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsDerivedFromDatatype
internal static bool IsDerivedFromDatatype(XmlSchemaDatatype derivedDataType, XmlSchemaDatatype baseDataType, XmlSchemaDerivationMethod except) {
if (DatatypeImplementation.AnySimpleType.Datatype == baseDataType) {
return true;
}
return derivedDataType.IsDerivedFrom(baseDataType);
}
示例2: IsComparable
internal override bool IsComparable(XmlSchemaDatatype dtype) {
XmlTypeCode thisCode = this.TypeCode;
XmlTypeCode otherCode = dtype.TypeCode;
if (thisCode == otherCode) { //They are both same built-in type or one is list and the other is list's itemType
return true;
}
if (GetPrimitiveTypeCode(thisCode) == GetPrimitiveTypeCode(otherCode)) {
return true;
}
if (this.IsDerivedFrom(dtype) || dtype.IsDerivedFrom(this)) { //One is union and the other is a member of the union
return true;
}
return false;
}
示例3: IsComparable
internal override bool IsComparable(XmlSchemaDatatype dtype)
{
XmlTypeCode typeCode = this.TypeCode;
XmlTypeCode code2 = dtype.TypeCode;
if (typeCode != code2)
{
if (GetPrimitiveTypeCode(typeCode) == GetPrimitiveTypeCode(code2))
{
return true;
}
if (!this.IsDerivedFrom(dtype) && !dtype.IsDerivedFrom(this))
{
return false;
}
}
return true;
}