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

◆ CheckValueFacets() [8/12]

override Exception System.Xml.Schema.ListFacetsChecker.CheckValueFacets ( object value,
XmlSchemaDatatype datatype )
inlinepackagevirtual

Reimplemented from System.Xml.Schema.FacetsChecker.

Definition at line 7 of file ListFacetsChecker.cs.

8 {
10 RestrictionFacets restriction = datatype.Restriction;
11 RestrictionFlags restrictionFlags = restriction?.Flags ?? ((RestrictionFlags)0);
12 if ((restrictionFlags & (RestrictionFlags.Length | RestrictionFlags.MinLength | RestrictionFlags.MaxLength)) != 0)
13 {
14 int length = array.Length;
15 if ((restrictionFlags & RestrictionFlags.Length) != 0 && restriction.Length != length)
16 {
17 return new XmlSchemaException(System.SR.Sch_LengthConstraintFailed, string.Empty);
18 }
19 if ((restrictionFlags & RestrictionFlags.MinLength) != 0 && length < restriction.MinLength)
20 {
21 return new XmlSchemaException(System.SR.Sch_MinLengthConstraintFailed, string.Empty);
22 }
23 if ((restrictionFlags & RestrictionFlags.MaxLength) != 0 && restriction.MaxLength < length)
24 {
25 return new XmlSchemaException(System.SR.Sch_MaxLengthConstraintFailed, string.Empty);
26 }
27 }
28 if ((restrictionFlags & RestrictionFlags.Enumeration) != 0 && !MatchEnumeration(value, restriction.Enumeration, datatype))
29 {
30 return new XmlSchemaException(System.SR.Sch_EnumerationConstraintFailed, string.Empty);
31 }
32 return null;
33 }
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.array, System.Xml.Array, System.Xml.Dictionary, System.Xml.Schema.RestrictionFacets.Flags, System.length, System.Xml.Schema.ListFacetsChecker.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.