System.Xml.Schema.Numeric2FacetsChecker.CheckValueFacets C# (CSharp) Method

CheckValueFacets() private method

private CheckValueFacets ( double value, XmlSchemaDatatype datatype ) : Exception
value double
datatype XmlSchemaDatatype
return System.Exception
        internal override Exception CheckValueFacets(double value, XmlSchemaDatatype datatype) {
            RestrictionFacets restriction = datatype.Restriction;
            RestrictionFlags flags = restriction != null ? restriction.Flags : 0;
            XmlValueConverter valueConverter = datatype.ValueConverter;

            if ((flags & RestrictionFlags.MaxInclusive) != 0) {
                if (value > valueConverter.ToDouble(restriction.MaxInclusive)) {
                    return new XmlSchemaException(Res.Sch_MaxInclusiveConstraintFailed, string.Empty);
                }
            }
            if ((flags & RestrictionFlags.MaxExclusive) != 0) {
                if (value >= valueConverter.ToDouble(restriction.MaxExclusive)) {
                    return new XmlSchemaException(Res.Sch_MaxExclusiveConstraintFailed, string.Empty);
                }
            }

            if ((flags & RestrictionFlags.MinInclusive) != 0) {
                if (value < (valueConverter.ToDouble(restriction.MinInclusive))) {
                    return new XmlSchemaException(Res.Sch_MinInclusiveConstraintFailed, string.Empty);
                }
            }
            
            if ((flags & RestrictionFlags.MinExclusive) != 0) {
                if (value <= valueConverter.ToDouble(restriction.MinExclusive)) {
                    return new XmlSchemaException(Res.Sch_MinExclusiveConstraintFailed, string.Empty);
                }
            }
            if ((flags & RestrictionFlags.Enumeration) != 0) {
                if (!MatchEnumeration(value, restriction.Enumeration, valueConverter)) {
                    return new XmlSchemaException(Res.Sch_EnumerationConstraintFailed, string.Empty);
                }
            }
            return null;
        }
        

Same methods

Numeric2FacetsChecker::CheckValueFacets ( float value, XmlSchemaDatatype datatype ) : Exception
Numeric2FacetsChecker::CheckValueFacets ( object value, XmlSchemaDatatype datatype ) : Exception