System.Xml.Schema.FacetsChecker.FacetsCompiler.CompileMinLengthFacet C# (CSharp) Method

CompileMinLengthFacet() private method

private CompileMinLengthFacet ( XmlSchemaFacet facet ) : void
facet XmlSchemaFacet
return void
        internal void CompileMinLengthFacet(XmlSchemaFacet facet) {
            CheckProhibitedFlag(facet, RestrictionFlags.MinLength, Res.Sch_MinLengthFacetProhibited);
            CheckDupFlag(facet, RestrictionFlags.MinLength, Res.Sch_DupMinLengthFacet);
            derivedRestriction.MinLength = XmlBaseConverter.DecimalToInt32((decimal)ParseFacetValue(nonNegativeInt, facet, Res.Sch_MinLengthFacetInvalid, null, null));
            
            if ((baseFixedFlags & RestrictionFlags.MinLength) != 0) {
                if (!datatype.IsEqual(datatype.Restriction.MinLength, derivedRestriction.MinLength)) {
                    throw new XmlSchemaException(Res.Sch_FacetBaseFixed, facet);
                }
            }
            if ((baseFlags & RestrictionFlags.MinLength) != 0) {
                if (datatype.Restriction.MinLength > derivedRestriction.MinLength) {
                    throw new XmlSchemaException(Res.Sch_MinLengthGtBaseMinLength, facet);
                }
            }
            if ((baseFlags & RestrictionFlags.Length) != 0) {
                if (datatype.Restriction.Length < derivedRestriction.MinLength) {
                    throw new XmlSchemaException(Res.Sch_MaxMinLengthBaseLength, facet);
                }
            }
            SetFlag(facet, RestrictionFlags.MinLength);
        }