本文整理汇总了C#中System.Xml.Schema.XmlSchemaDatatype.Compare方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaDatatype.Compare方法的具体用法?C# XmlSchemaDatatype.Compare怎么用?C# XmlSchemaDatatype.Compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaDatatype
的用法示例。
在下文中一共展示了XmlSchemaDatatype.Compare方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckValueFacets
internal override Exception CheckValueFacets(DateTime value, XmlSchemaDatatype datatype)
{
RestrictionFacets restriction = datatype.Restriction;
RestrictionFlags flags = (restriction != null) ? restriction.Flags : ((RestrictionFlags) 0);
if (((flags & RestrictionFlags.MaxInclusive) != 0) && (datatype.Compare(value, (DateTime) restriction.MaxInclusive) > 0))
{
return new XmlSchemaException("Sch_MaxInclusiveConstraintFailed", string.Empty);
}
if (((flags & RestrictionFlags.MaxExclusive) != 0) && (datatype.Compare(value, (DateTime) restriction.MaxExclusive) >= 0))
{
return new XmlSchemaException("Sch_MaxExclusiveConstraintFailed", string.Empty);
}
if (((flags & RestrictionFlags.MinInclusive) != 0) && (datatype.Compare(value, (DateTime) restriction.MinInclusive) < 0))
{
return new XmlSchemaException("Sch_MinInclusiveConstraintFailed", string.Empty);
}
if (((flags & RestrictionFlags.MinExclusive) != 0) && (datatype.Compare(value, (DateTime) restriction.MinExclusive) <= 0))
{
return new XmlSchemaException("Sch_MinExclusiveConstraintFailed", string.Empty);
}
if (((flags & RestrictionFlags.Enumeration) != 0) && !this.MatchEnumeration(value, restriction.Enumeration, datatype))
{
return new XmlSchemaException("Sch_EnumerationConstraintFailed", string.Empty);
}
return null;
}
示例2: MatchEnumeration
private bool MatchEnumeration(DateTime value, ArrayList enumeration, XmlSchemaDatatype datatype)
{
for (int i = 0; i < enumeration.Count; i++)
{
if (datatype.Compare(value, (DateTime) enumeration[i]) == 0)
{
return true;
}
}
return false;
}
示例3: MatchEnumeration
internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)
{
for (int i = 0; i < enumeration.Count; i++)
{
if (datatype.Compare(value, enumeration[i]) == 0)
{
return true;
}
}
return false;
}
示例4: MatchEnumeration
internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype) {
for (int i = 0; i < enumeration.Count; ++i) {
if (datatype.Compare(value, enumeration[i]) == 0) { //Compare on Datatype_union will compare two XsdSimpleValue
return true;
}
}
return false;
}
示例5: MatchEnumeration
internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype) {
foreach(object correctValue in enumeration) {
if (datatype.Compare(value, correctValue) == 0) { //Compare on Datatype_union will compare two XsdSimpleValue
return true;
}
}
return false;
}