System.Xml.Schema.XmlSchemaDatatype.Compare C# (CSharp) Method

Compare() abstract private method

abstract private Compare ( object value1, object value2 ) : int
value1 object
value2 object
return int
        internal abstract int Compare(object value1, object value2);

Usage Example

 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;
 }
All Usage Examples Of System.Xml.Schema.XmlSchemaDatatype::Compare