Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlSerializerNamespaces.cs
Go to the documentation of this file.
4
6
8{
10
11 public int Count
12 {
13 get
14 {
15 if (_namespaces != null)
16 {
17 return _namespaces.Count;
18 }
19 return 0;
20 }
21 }
22
24
26 {
27 get
28 {
29 if (_namespaces == null)
30 {
32 }
33 return _namespaces;
34 }
35 }
36
38 {
39 get
40 {
41 if (_namespaces == null || _namespaces.Count == 0)
42 {
43 return null;
44 }
45 return new ArrayList(_namespaces.Values);
46 }
47 }
48
50 {
51 }
52
57
66
75
76 public void Add(string prefix, string? ns)
77 {
78 if (prefix != null && prefix.Length > 0)
79 {
81 }
82 if (ns != null && ns.Length > 0)
83 {
85 }
87 }
88
89 internal void AddInternal(string prefix, string ns)
90 {
92 }
93
95 {
96 if (_namespaces == null || _namespaces.Count == 0)
97 {
98 return Array.Empty<XmlQualifiedName>();
99 }
102 return array;
103 }
104
105 internal bool TryLookupPrefix(string ns, out string prefix)
106 {
107 prefix = null;
108 if (_namespaces == null || _namespaces.Count == 0 || string.IsNullOrEmpty(ns))
109 {
110 return false;
111 }
113 {
114 if (!string.IsNullOrEmpty(@namespace.Key) && @namespace.Value.Namespace == ns)
115 {
116 prefix = @namespace.Key;
117 return true;
118 }
119 }
120 return false;
121 }
122
123 internal bool TryLookupNamespace(string prefix, out string ns)
124 {
125 ns = null;
126 if (_namespaces == null || _namespaces.Count == 0 || string.IsNullOrEmpty(prefix))
127 {
128 return false;
129 }
131 {
132 ns = value.Namespace;
133 return true;
134 }
135 return false;
136 }
137}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void Add(TKey key, TValue value)
XmlSerializerNamespaces(XmlSerializerNamespaces namespaces)
XmlSerializerNamespaces(IList< XmlQualifiedName > namespaces)
Dictionary< string, XmlQualifiedName > NamespacesInternal
Dictionary< string, XmlQualifiedName >.ValueCollection Namespaces
Dictionary< string, XmlQualifiedName > _namespaces
static string VerifyNCName(string name)