System.Xml.Schema.DateTimeFacetsChecker.CheckValueFacets C# (CSharp) Méthode

CheckValueFacets() private méthode

private CheckValueFacets ( System.DateTime value, XmlSchemaDatatype datatype ) : Exception
value System.DateTime
datatype XmlSchemaDatatype
Résultat System.Exception
        internal override Exception CheckValueFacets(DateTime value, XmlSchemaDatatype datatype) {
            RestrictionFacets restriction = datatype.Restriction;
            RestrictionFlags flags = restriction != null ? restriction.Flags : 0;
            
            if ((flags & RestrictionFlags.MaxInclusive) != 0) {
                if (datatype.Compare(value, (DateTime)restriction.MaxInclusive) > 0) {
                    return new XmlSchemaException(Res.Sch_MaxInclusiveConstraintFailed, string.Empty);
                }
            }
            
            if ((flags & RestrictionFlags.MaxExclusive) != 0) {
                if (datatype.Compare(value, (DateTime)restriction.MaxExclusive) >= 0) {
                    return new XmlSchemaException(Res.Sch_MaxExclusiveConstraintFailed, string.Empty);
                }
            }
            
            if ((flags & RestrictionFlags.MinInclusive) != 0) {
                if (datatype.Compare(value, (DateTime)restriction.MinInclusive) < 0) {
                    return new XmlSchemaException(Res.Sch_MinInclusiveConstraintFailed, string.Empty);
                } 
            }
            
            if ((flags & RestrictionFlags.MinExclusive) != 0) {
                if (datatype.Compare(value, (DateTime)restriction.MinExclusive) <= 0) {
                    return new XmlSchemaException(Res.Sch_MinExclusiveConstraintFailed, string.Empty);
                }
            }
            if ((flags & RestrictionFlags.Enumeration) != 0) {
                if (!MatchEnumeration(value, restriction.Enumeration, datatype)) {
                    return new XmlSchemaException(Res.Sch_EnumerationConstraintFailed, string.Empty);
                }
            }
            return null;
        }

Same methods

DateTimeFacetsChecker::CheckValueFacets ( object value, XmlSchemaDatatype datatype ) : Exception