Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompileMaxLengthFacet()

void System.Xml.Schema.FacetsChecker.FacetsCompiler.CompileMaxLengthFacet ( XmlSchemaFacet facet)
inlinepackage

Definition at line 117 of file FacetsChecker.cs.

118 {
119 CheckProhibitedFlag(facet, RestrictionFlags.MaxLength, System.SR.Sch_MaxLengthFacetProhibited);
120 CheckDupFlag(facet, RestrictionFlags.MaxLength, System.SR.Sch_DupMaxLengthFacet);
121 _derivedRestriction.MaxLength = XmlBaseConverter.DecimalToInt32((decimal)ParseFacetValue(_nonNegativeInt, facet, System.SR.Sch_MaxLengthFacetInvalid, null, null));
122 if ((_baseFixedFlags & RestrictionFlags.MaxLength) != 0 && !_datatype.IsEqual(_datatype.Restriction.MaxLength, _derivedRestriction.MaxLength))
123 {
124 throw new XmlSchemaException(System.SR.Sch_FacetBaseFixed, facet);
125 }
126 if ((_baseFlags & RestrictionFlags.MaxLength) != 0 && _datatype.Restriction.MaxLength < _derivedRestriction.MaxLength)
127 {
128 throw new XmlSchemaException(System.SR.Sch_MaxLengthGtBaseMaxLength, facet);
129 }
130 if ((_baseFlags & RestrictionFlags.Length) != 0 && _datatype.Restriction.Length > _derivedRestriction.MaxLength)
131 {
132 throw new XmlSchemaException(System.SR.Sch_MaxMinLengthBaseLength, facet);
133 }
134 SetFlag(facet, RestrictionFlags.MaxLength);
135 }
static string Sch_MaxLengthFacetInvalid
Definition SR.cs:658
static string Sch_MaxMinLengthBaseLength
Definition SR.cs:1088
static string Sch_DupMaxLengthFacet
Definition SR.cs:614
static string Sch_MaxLengthGtBaseMaxLength
Definition SR.cs:1086
static string Sch_MaxLengthFacetProhibited
Definition SR.cs:634
static string Sch_FacetBaseFixed
Definition SR.cs:1114
Definition SR.cs:7
override bool IsEqual(object o1, object o2)
void SetFlag(XmlSchemaFacet facet, RestrictionFlags flag)
void CheckDupFlag(XmlSchemaFacet facet, RestrictionFlags flag, string errorCode)
object ParseFacetValue(XmlSchemaDatatype datatype, XmlSchemaFacet facet, string code, IXmlNamespaceResolver nsmgr, XmlNameTable nameTable)
void CheckProhibitedFlag(XmlSchemaFacet facet, RestrictionFlags flag, string errorCode)
readonly RestrictionFacets _derivedRestriction
readonly DatatypeImplementation _datatype

References System.Xml.Schema.FacetsChecker.FacetsCompiler._baseFixedFlags, System.Xml.Schema.FacetsChecker.FacetsCompiler._baseFlags, System.Xml.Schema.FacetsChecker.FacetsCompiler._datatype, System.Xml.Schema.FacetsChecker.FacetsCompiler._derivedRestriction, System.Xml.Schema.FacetsChecker.FacetsCompiler._nonNegativeInt, System.Xml.Schema.FacetsChecker.FacetsCompiler.CheckDupFlag(), System.Xml.Schema.FacetsChecker.FacetsCompiler.CheckProhibitedFlag(), System.Xml.Schema.XmlBaseConverter.DecimalToInt32(), System.Xml.Dictionary, System.Xml.Schema.DatatypeImplementation.IsEqual(), System.Xml.Schema.RestrictionFacets.Length, System.Xml.Schema.RestrictionFacets.MaxLength, System.Xml.Schema.FacetsChecker.FacetsCompiler.ParseFacetValue(), System.Xml.Schema.DatatypeImplementation.Restriction, System.SR.Sch_DupMaxLengthFacet, System.SR.Sch_FacetBaseFixed, System.SR.Sch_MaxLengthFacetInvalid, System.SR.Sch_MaxLengthFacetProhibited, System.SR.Sch_MaxLengthGtBaseMaxLength, System.SR.Sch_MaxMinLengthBaseLength, and System.Xml.Schema.FacetsChecker.FacetsCompiler.SetFlag().