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

◆ CheckValueFacets() [1/12]

override Exception System.Xml.Schema.BinaryFacetsChecker.CheckValueFacets ( byte[] value,
XmlSchemaDatatype datatype )
inlinepackagevirtual

Reimplemented from System.Xml.Schema.FacetsChecker.

Definition at line 13 of file BinaryFacetsChecker.cs.

14 {
15 RestrictionFacets restriction = datatype.Restriction;
16 int num = value.Length;
17 RestrictionFlags restrictionFlags = restriction?.Flags ?? ((RestrictionFlags)0);
18 if (restrictionFlags != 0)
19 {
20 if ((restrictionFlags & RestrictionFlags.Length) != 0 && restriction.Length != num)
21 {
22 return new XmlSchemaException(System.SR.Sch_LengthConstraintFailed, string.Empty);
23 }
24 if ((restrictionFlags & RestrictionFlags.MinLength) != 0 && num < restriction.MinLength)
25 {
26 return new XmlSchemaException(System.SR.Sch_MinLengthConstraintFailed, string.Empty);
27 }
28 if ((restrictionFlags & RestrictionFlags.MaxLength) != 0 && restriction.MaxLength < num)
29 {
30 return new XmlSchemaException(System.SR.Sch_MaxLengthConstraintFailed, string.Empty);
31 }
32 if ((restrictionFlags & RestrictionFlags.Enumeration) != 0 && !MatchEnumeration(value, restriction.Enumeration, datatype))
33 {
34 return new XmlSchemaException(System.SR.Sch_EnumerationConstraintFailed, string.Empty);
35 }
36 }
37 return null;
38 }
static string Sch_LengthConstraintFailed
Definition SR.cs:686
static string Sch_MinLengthConstraintFailed
Definition SR.cs:688
static string Sch_EnumerationConstraintFailed
Definition SR.cs:694
static string Sch_MaxLengthConstraintFailed
Definition SR.cs:690
Definition SR.cs:7
override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)

References System.Xml.Dictionary, System.Xml.Schema.RestrictionFacets.Length, System.Xml.Schema.BinaryFacetsChecker.MatchEnumeration(), System.Xml.Schema.XmlSchemaDatatype.Restriction, System.SR.Sch_EnumerationConstraintFailed, System.SR.Sch_LengthConstraintFailed, System.SR.Sch_MaxLengthConstraintFailed, System.SR.Sch_MinLengthConstraintFailed, and System.value.