Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FromMappings() [2/2]

static XmlSerializer[] System.Xml.Serialization.XmlSerializer.FromMappings ( XmlMapping?[] mappings,
Type? type )
inlinestatic

Definition at line 595 of file XmlSerializer.cs.

596 {
597 if (mappings == null || mappings.Length == 0)
598 {
599 return Array.Empty<XmlSerializer>();
600 }
601 bool flag = false;
602 foreach (XmlMapping xmlMapping in mappings)
603 {
604 if (xmlMapping.IsSoap)
605 {
606 flag = true;
607 }
608 }
609 if ((flag && ReflectionMethodEnabled) || Mode == SerializationMode.ReflectionOnly)
610 {
612 }
613 XmlSerializerImplementation contract = null;
614 Assembly assembly = ((type == null) ? null : TempAssembly.LoadGeneratedAssembly(type, null, out contract));
615 TempAssembly tempAssembly = null;
616 if (assembly == null)
617 {
618 if (Mode == SerializationMode.PreGenOnly)
619 {
620 AssemblyName name = type.Assembly.GetName();
621 string tempAssemblyName = Compiler.GetTempAssemblyName(name, null);
623 }
624 if (XmlMapping.IsShallow(mappings))
625 {
626 return Array.Empty<XmlSerializer>();
627 }
628 if (type == null)
629 {
630 tempAssembly = new TempAssembly(mappings, new Type[1] { type }, null, null);
632 contract = tempAssembly.Contract;
633 for (int j = 0; j < array.Length; j++)
634 {
635 array[j] = (XmlSerializer)contract.TypedSerializers[mappings[j].Key];
636 array[j].SetTempAssembly(tempAssembly, mappings[j]);
637 }
638 return array;
639 }
641 }
643 for (int k = 0; k < array2.Length; k++)
644 {
645 array2[k] = (XmlSerializer)contract.TypedSerializers[mappings[k].Key];
646 }
647 return array2;
648 }
static string FailLoadAssemblyUnderPregenMode
Definition SR.cs:2146
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
static XmlSerializer[] GetReflectionBasedSerializers(XmlMapping[] mappings, Type type)
static XmlSerializer[] GetSerializersFromCache(XmlMapping[] mappings, Type type)

References System.Xml.Serialization.XmlSerializer.XmlSerializer(), System.array, System.Xml.Dictionary, System.SR.FailLoadAssemblyUnderPregenMode, System.SR.Format(), System.Xml.Serialization.XmlSerializer.GetReflectionBasedSerializers(), System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(), System.Xml.Serialization.Compiler.GetTempAssemblyName(), System.Xml.Serialization.XmlMapping.IsShallow(), System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly(), System.Xml.Serialization.XmlSerializer.ReflectionMethodEnabled, and System.type.