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

◆ CompileLengthFacet()

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

Definition at line 73 of file FacetsChecker.cs.

74 {
76 CheckDupFlag(facet, RestrictionFlags.Length, System.SR.Sch_DupLengthFacet);
77 _derivedRestriction.Length = XmlBaseConverter.DecimalToInt32((decimal)ParseFacetValue(_nonNegativeInt, facet, System.SR.Sch_LengthFacetInvalid, null, null));
78 if ((_baseFixedFlags & RestrictionFlags.Length) != 0 && !_datatype.IsEqual(_datatype.Restriction.Length, _derivedRestriction.Length))
79 {
80 throw new XmlSchemaException(System.SR.Sch_FacetBaseFixed, facet);
81 }
82 if ((_baseFlags & RestrictionFlags.Length) != 0 && _datatype.Restriction.Length < _derivedRestriction.Length)
83 {
84 throw new XmlSchemaException(System.SR.Sch_LengthGtBaseLength, facet);
85 }
86 if ((_baseFlags & RestrictionFlags.MinLength) != 0 && _datatype.Restriction.MinLength > _derivedRestriction.Length)
87 {
88 throw new XmlSchemaException(System.SR.Sch_MaxMinLengthBaseLength, facet);
89 }
90 if ((_baseFlags & RestrictionFlags.MaxLength) != 0 && _datatype.Restriction.MaxLength < _derivedRestriction.Length)
91 {
92 throw new XmlSchemaException(System.SR.Sch_MaxMinLengthBaseLength, facet);
93 }
94 SetFlag(facet, RestrictionFlags.Length);
95 }
static string Sch_MaxMinLengthBaseLength
Definition SR.cs:1088
static string Sch_LengthFacetProhibited
Definition SR.cs:630
static string Sch_FacetBaseFixed
Definition SR.cs:1114
static string Sch_DupLengthFacet
Definition SR.cs:610
static string Sch_LengthGtBaseLength
Definition SR.cs:1082
static string Sch_LengthFacetInvalid
Definition SR.cs:654
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.RestrictionFacets.MinLength, System.Xml.Schema.FacetsChecker.FacetsCompiler.ParseFacetValue(), System.Xml.Schema.DatatypeImplementation.Restriction, System.SR.Sch_DupLengthFacet, System.SR.Sch_FacetBaseFixed, System.SR.Sch_LengthFacetInvalid, System.SR.Sch_LengthFacetProhibited, System.SR.Sch_LengthGtBaseLength, System.SR.Sch_MaxMinLengthBaseLength, and System.Xml.Schema.FacetsChecker.FacetsCompiler.SetFlag().