Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlListConverter.cs
Go to the documentation of this file.
3using System.Text;
5
6namespace System.Xml.Schema;
7
9{
11
17
23
24 protected XmlListConverter(XmlSchemaType schemaType)
25 : base(schemaType)
26 {
27 }
28
45
47 {
48 if (value == null)
49 {
50 throw new ArgumentNullException("value");
51 }
52 if (destinationType == null)
53 {
54 throw new ArgumentNullException("destinationType");
55 }
57 }
58
60 {
63 {
64 destinationType = base.DefaultClrType;
65 }
67 {
69 }
71 {
73 {
74 return value;
75 }
77 }
79 {
80 value = StringAsList((string)value);
81 }
82 if (destinationType.IsArray)
83 {
84 Type elementType = destinationType.GetElementType();
86 {
88 }
89 if (type == destinationType)
90 {
91 return value;
92 }
94 {
96 }
98 {
100 }
102 {
104 }
106 {
108 }
110 {
112 }
114 {
116 }
118 {
120 }
122 {
124 }
126 {
128 }
130 {
132 }
134 {
136 }
138 {
140 }
142 {
144 }
146 {
148 }
150 {
152 }
154 {
156 }
158 {
160 }
162 {
164 }
166 {
168 }
170 {
172 }
174 {
176 }
178 {
180 }
182 }
183 if (type == base.DefaultClrType && type != XmlBaseConverter.ObjectArrayType)
184 {
185 return value;
186 }
187 return ToList(value, nsResolver);
188 }
189
190 private bool IsListType(Type type)
191 {
193 {
194 return true;
195 }
196 return type.IsArray;
197 }
198
200 {
201 if (list is IList list2)
202 {
203 T[] array = new T[list2.Count];
204 for (int i = 0; i < list2.Count; i++)
205 {
207 }
208 return array;
209 }
210 IEnumerable enumerable = list as IEnumerable;
211 List<T> list3 = new List<T>();
212 foreach (object item in enumerable)
213 {
215 }
216 return list3.ToArray();
217 }
218
220 {
221 if (list is IList list2)
222 {
223 object[] array = new object[list2.Count];
224 for (int i = 0; i < list2.Count; i++)
225 {
227 }
228 return array;
229 }
230 IEnumerable enumerable = list as IEnumerable;
232 foreach (object item in enumerable)
233 {
235 }
236 return list3;
237 }
238
240 {
242 }
243
245 {
247 foreach (object item in list)
248 {
249 if (item != null)
250 {
251 if (stringBuilder.Length != 0)
252 {
253 stringBuilder.Append(' ');
254 }
256 }
257 }
258 return stringBuilder.ToString();
259 }
260
269}
void Add(TKey key, TValue value)
static string XmlConvert_TypeListBadMapping2
Definition SR.cs:380
static string XmlConvert_TypeListBadMapping
Definition SR.cs:378
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408
static readonly XmlValueConverter AnyAtomic
static readonly XmlValueConverter Item
static readonly XmlValueConverter AnyAtomicList
static readonly XmlValueConverter ItemList
static readonly Type XmlAtomicValueType
static readonly Type DateTimeOffsetType
static readonly Type XPathNavigatorType
static readonly Type XmlQualifiedNameType
T[] ToArray< T >(object list, IXmlNamespaceResolver nsResolver)
override object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
new Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType)
static XmlValueConverter Create(XmlValueConverter atomicConverter)
List< string > StringAsList(string value)
XmlListConverter(XmlSchemaType schemaType)
XmlListConverter(XmlBaseConverter atomicConverter)
IList ToList(object list, IXmlNamespaceResolver nsResolver)
string ListAsString(IEnumerable list, IXmlNamespaceResolver nsResolver)
override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
XmlListConverter(XmlBaseConverter atomicConverter, Type clrTypeDefault)
static readonly XmlValueConverter Untyped
static readonly XmlValueConverter UntypedList
object ChangeType(bool value, Type destinationType)
static string[] SplitString(string value)