Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ListFacetsChecker.cs
Go to the documentation of this file.
2
3namespace System.Xml.Schema;
4
5internal sealed class ListFacetsChecker : FacetsChecker
6{
7 internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype)
8 {
12 if ((restrictionFlags & (RestrictionFlags.Length | RestrictionFlags.MinLength | RestrictionFlags.MaxLength)) != 0)
13 {
14 int length = array.Length;
16 {
18 }
19 if ((restrictionFlags & RestrictionFlags.MinLength) != 0 && length < restriction.MinLength)
20 {
22 }
23 if ((restrictionFlags & RestrictionFlags.MaxLength) != 0 && restriction.MaxLength < length)
24 {
26 }
27 }
28 if ((restrictionFlags & RestrictionFlags.Enumeration) != 0 && !MatchEnumeration(value, restriction.Enumeration, datatype))
29 {
31 }
32 return null;
33 }
34
35 internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)
36 {
37 for (int i = 0; i < enumeration.Count; i++)
38 {
39 if (datatype.Compare(value, enumeration[i]) == 0)
40 {
41 return true;
42 }
43 }
44 return false;
45 }
46}
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)
override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype)
int Compare(object value1, object value2)