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