Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlNameEx.cs
Go to the documentation of this file.
2
3namespace System.Xml;
4
5internal sealed class XmlNameEx : XmlName
6{
7 private byte _flags;
8
10
11 private readonly XmlSchemaType _schemaType;
12
13 private readonly object _decl;
14
16 {
17 get
18 {
20 {
21 return XmlSchemaValidity.NotKnown;
22 }
23 return (XmlSchemaValidity)(_flags & 3);
24 }
25 }
26
27 public override bool IsDefault => (_flags & 4) != 0;
28
29 public override bool IsNil => (_flags & 8) != 0;
30
32
34
36
38
39 internal XmlNameEx(string prefix, string localName, string ns, int hashCode, XmlDocument ownerDoc, XmlName next, IXmlSchemaInfo schemaInfo)
40 : base(prefix, localName, ns, hashCode, ownerDoc, next)
41 {
42 SetValidity(schemaInfo.Validity);
43 SetIsDefault(schemaInfo.IsDefault);
44 SetIsNil(schemaInfo.IsNil);
45 _memberType = schemaInfo.MemberType;
46 _schemaType = schemaInfo.SchemaType;
48 }
49
51 {
52 _flags = (byte)((_flags & 0xFFFFFFFCu) | (byte)value);
53 }
54
55 public void SetIsDefault(bool value)
56 {
57 if (value)
58 {
59 _flags |= 4;
60 }
61 else
62 {
63 _flags = (byte)(_flags & 0xFFFFFFFBu);
64 }
65 }
66
67 public void SetIsNil(bool value)
68 {
69 if (value)
70 {
71 _flags |= 8;
72 }
73 else
74 {
75 _flags = (byte)(_flags & 0xFFFFFFF7u);
76 }
77 }
78
79 public override bool Equals(IXmlSchemaInfo schemaInfo)
80 {
81 if (schemaInfo != null && schemaInfo.Validity == (XmlSchemaValidity)(_flags & 3) && schemaInfo.IsDefault == ((_flags & 4) != 0) && schemaInfo.IsNil == ((_flags & 8) != 0) && schemaInfo.MemberType == _memberType && schemaInfo.SchemaType == _schemaType && schemaInfo.SchemaElement == _decl as XmlSchemaElement && schemaInfo.SchemaAttribute == _decl as XmlSchemaAttribute)
82 {
83 return true;
84 }
85 return false;
86 }
87}
readonly XmlSchemaType _schemaType
Definition XmlNameEx.cs:11
void SetValidity(XmlSchemaValidity value)
Definition XmlNameEx.cs:50
override XmlSchemaValidity Validity
Definition XmlNameEx.cs:16
override bool Equals(IXmlSchemaInfo schemaInfo)
Definition XmlNameEx.cs:79
readonly XmlSchemaSimpleType _memberType
Definition XmlNameEx.cs:9
override XmlSchemaAttribute SchemaAttribute
Definition XmlNameEx.cs:37
override bool IsNil
Definition XmlNameEx.cs:29
override XmlSchemaElement SchemaElement
Definition XmlNameEx.cs:35
void SetIsNil(bool value)
Definition XmlNameEx.cs:67
readonly object _decl
Definition XmlNameEx.cs:13
override bool IsDefault
Definition XmlNameEx.cs:27
void SetIsDefault(bool value)
Definition XmlNameEx.cs:55
override XmlSchemaSimpleType MemberType
Definition XmlNameEx.cs:31
XmlNameEx(string prefix, string localName, string ns, int hashCode, XmlDocument ownerDoc, XmlName next, IXmlSchemaInfo schemaInfo)
Definition XmlNameEx.cs:39
XmlDocument ownerDoc
Definition XmlName.cs:17
XmlSchemaAttribute? SchemaAttribute
XmlSchemaSimpleType? MemberType