System.Xml.Schema.FacetsChecker.FacetsCompiler.CompileTotalDigitsFacet C# (CSharp) Méthode

CompileTotalDigitsFacet() private méthode

private CompileTotalDigitsFacet ( XmlSchemaFacet facet ) : void
facet XmlSchemaFacet
Résultat void
        internal void CompileTotalDigitsFacet(XmlSchemaFacet facet) {
            CheckProhibitedFlag(facet, RestrictionFlags.TotalDigits, Res.Sch_TotalDigitsFacetProhibited);
            CheckDupFlag(facet, RestrictionFlags.TotalDigits, Res.Sch_DupTotalDigitsFacet);
            XmlSchemaDatatype positiveInt = DatatypeImplementation.GetSimpleTypeFromTypeCode(XmlTypeCode.PositiveInteger).Datatype;                        
            derivedRestriction.TotalDigits = XmlBaseConverter.DecimalToInt32((decimal)ParseFacetValue(positiveInt, facet, Res.Sch_TotalDigitsFacetInvalid, null, null));
            
            if ((baseFixedFlags & RestrictionFlags.TotalDigits) != 0) {
                if (!datatype.IsEqual(datatype.Restriction.TotalDigits, derivedRestriction.TotalDigits)) {
                    throw new XmlSchemaException(Res.Sch_FacetBaseFixed, facet);
                }
            }
            if ((baseFlags & RestrictionFlags.TotalDigits) != 0) {
                if(derivedRestriction.TotalDigits > datatype.Restriction.TotalDigits) {
                    throw new XmlSchemaException(Res.Sch_TotalDigitsMismatch, string.Empty);
                }
            }
            SetFlag(facet, RestrictionFlags.TotalDigits);
        }