Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ RetrieveSerializableSchema()

void System.Xml.Serialization.SerializableMapping.RetrieveSerializableSchema ( )
inlineprivate

Definition at line 285 of file SerializableMapping.cs.

286 {
287 if (!_needSchema)
288 {
289 return;
290 }
291 _needSchema = false;
292 if (_getSchemaMethod != null)
293 {
294 if (_schemas == null)
295 {
296 _schemas = new XmlSchemaSet();
297 }
298 object obj = _getSchemaMethod.Invoke(null, new object[1] { _schemas });
299 _xsiType = XmlQualifiedName.Empty;
300 if (obj != null)
301 {
302 if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType))
303 {
306 }
307 else
308 {
309 if (!typeof(XmlQualifiedName).IsAssignableFrom(_getSchemaMethod.ReturnType))
310 {
311 throw new InvalidOperationException(System.SR.Format(System.SR.XmlGetSchemaMethodReturnType, _type.Name, _getSchemaMethod.Name, "XmlSchemaProviderAttribute", typeof(XmlQualifiedName).FullName));
312 }
313 _xsiType = (XmlQualifiedName)obj;
314 if (_xsiType.IsEmpty)
315 {
317 }
318 }
319 }
320 else
321 {
322 _any = true;
323 }
326 if (!_xsiType.IsEmpty && _xsiType.Namespace != "http://www.w3.org/2001/XMLSchema")
327 {
329 if (arrayList.Count == 0)
330 {
332 }
333 if (arrayList.Count > 1)
334 {
336 }
338 if (xmlSchema == null)
339 {
341 }
343 if (_xsdType == null)
344 {
346 }
348 }
349 }
350 else
351 {
352 IXmlSerializable xmlSerializable = (IXmlSerializable)Activator.CreateInstance(_type);
353 _schema = xmlSerializable.GetSchema();
354 if (_schema != null && (_schema.Id == null || _schema.Id.Length == 0))
355 {
357 }
358 }
359 }
object? Invoke(object? obj, object?[]? parameters)
static string XmlSerializableNameMissing1
Definition SR.cs:1408
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlGetSchemaTypeMissing
Definition SR.cs:1760
static string XmlGetSchemaInclude
Definition SR.cs:1762
static string XmlGetSchemaEmptyTypeName
Definition SR.cs:1758
static string XmlMissingSchema
Definition SR.cs:1618
static string XmlGetSchemaMethodReturnType
Definition SR.cs:1756
Definition SR.cs:7
string? FullName
Definition Type.cs:47
static void ValidationCallbackWithErrorCode(object sender, ValidationEventArgs args)
static readonly XmlQualifiedName Empty

References System.Xml.Serialization.SerializableMapping._any, System.Xml.Serialization.SerializableMapping._getSchemaMethod, System.Xml.Serialization.SerializableMapping._needSchema, System.Xml.Serialization.SerializableMapping._schema, System.Xml.Serialization.SerializableMapping._schemas, System.Xml.Serialization.SerializableMapping._type, System.Xml.Serialization.SerializableMapping._xsdType, System.Xml.Serialization.SerializableMapping._xsiType, System.Xml.Schema.XmlSchemaSet.Compile(), System.Activator.CreateInstance(), System.Reflection.MemberInfo.DeclaringType, System.Xml.Dictionary, System.Xml.XmlQualifiedName.Empty, System.SR.Format(), System.Type.FullName, System.FullName, System.Xml.Schema.XmlSchema.Id, System.Reflection.MethodBase.Invoke(), System.Xml.XmlQualifiedName.IsEmpty, System.Reflection.MemberInfo.Name, System.Xml.XmlQualifiedName.Name, System.Xml.XmlQualifiedName.Namespace, System.obj, System.Xml.Schema.XmlSchemaType.QualifiedName, System.Xml.Schema.XmlSchemaType.Redefined, System.Reflection.MethodInfo.ReturnType, System.Xml.Schema.XmlSchemaSet.Schemas(), System.Xml.Serialization.SerializableMapping.ValidationCallbackWithErrorCode(), System.SR.XmlGetSchemaEmptyTypeName, System.SR.XmlGetSchemaInclude, System.SR.XmlGetSchemaMethodReturnType, System.SR.XmlGetSchemaTypeMissing, System.SR.XmlMissingSchema, and System.SR.XmlSerializableNameMissing1.