Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlMapping.cs
Go to the documentation of this file.
2
3public abstract class XmlMapping
4{
5 private readonly TypeScope _scope;
6
7 private bool _generateSerializer;
8
9 private bool _isSoap;
10
11 private readonly ElementAccessor _accessor;
12
13 private string _key;
14
15 private readonly bool _shallow;
16
17 private readonly XmlMappingAccess _access;
18
20
21 internal TypeScope? Scope => _scope;
22
24
25 public string XsdElementName => Accessor.Name;
26
27 public string? Namespace => _accessor.Namespace;
28
29 internal bool GenerateSerializer
30 {
31 get
32 {
34 }
35 set
36 {
38 }
39 }
40
41 internal bool IsReadable => (_access & XmlMappingAccess.Read) != 0;
42
43 internal bool IsWriteable => (_access & XmlMappingAccess.Write) != 0;
44
45 internal bool IsSoap
46 {
47 get
48 {
49 return _isSoap;
50 }
51 set
52 {
53 _isSoap = value;
54 }
55 }
56
57 internal string? Key => _key;
58
63
65 {
66 _scope = scope;
69 _shallow = scope == null;
70 }
71
72 public void SetKey(string? key)
73 {
75 }
76
77 internal void SetKeyInternal(string key)
78 {
79 _key = key;
80 }
81
82 internal static string GenerateKey(Type type, XmlRootAttribute root, string ns)
83 {
84 if (root == null)
85 {
87 }
88 return type.FullName + ":" + ((root == null) ? string.Empty : root.GetKey()) + ":" + ((ns == null) ? string.Empty : ns);
89 }
90
91 internal void CheckShallow()
92 {
93 if (_shallow)
94 {
96 }
97 }
98
99 internal static bool IsShallow(XmlMapping[] mappings)
100 {
101 for (int i = 0; i < mappings.Length; i++)
102 {
103 if (mappings[i] == null || mappings[i]._shallow)
104 {
105 return true;
106 }
107 }
108 return false;
109 }
110}
static string XmlMelformMapping
Definition SR.cs:1774
Definition SR.cs:7
static string UnescapeName(string name)
Definition Accessor.cs:191
static object GetAttr(MemberInfo memberInfo, Type attrType)
XmlMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access)
Definition XmlMapping.cs:64
XmlMapping(TypeScope scope, ElementAccessor accessor)
Definition XmlMapping.cs:59
static bool IsShallow(XmlMapping[] mappings)
Definition XmlMapping.cs:99
readonly ElementAccessor _accessor
Definition XmlMapping.cs:11
static string GenerateKey(Type type, XmlRootAttribute root, string ns)
Definition XmlMapping.cs:82
readonly XmlMappingAccess _access
Definition XmlMapping.cs:17