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

◆ GenerateSerializer()

static bool System.Xml.Serialization.XmlSerializer.GenerateSerializer ( Type[] types,
XmlMapping[] mappings,
Stream stream )
inlinestaticpackage

Definition at line 665 of file XmlSerializer.cs.

666 {
667 if (types == null || types.Length == 0)
668 {
669 return false;
670 }
671 if (mappings == null)
672 {
673 throw new ArgumentNullException("mappings");
674 }
675 if (stream == null)
676 {
677 throw new ArgumentNullException("stream");
678 }
679 if (XmlMapping.IsShallow(mappings))
680 {
682 }
683 Assembly assembly = null;
684 foreach (Type type in types)
685 {
686 if (DynamicAssemblies.IsTypeDynamic(type))
687 {
689 }
690 if (assembly == null)
691 {
692 assembly = type.Assembly;
693 }
694 else if (type.Assembly != assembly)
695 {
696 string text = assembly.Location;
697 if (text == string.Empty)
698 {
699 text = assembly.FullName;
700 }
701 throw new ArgumentException(System.SR.Format(System.SR.XmlPregenOrphanType, type.FullName, text), "types");
702 }
703 }
704 return TempAssembly.GenerateSerializerToStream(mappings, types, null, assembly, new Hashtable(), stream);
705 }
static string XmlMelformMapping
Definition SR.cs:1774
static string XmlPregenTypeDynamic
Definition SR.cs:2142
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlPregenOrphanType
Definition SR.cs:2144
Definition SR.cs:7

References System.Xml.ArgumentException, System.SR.Format(), System.Xml.Serialization.TempAssembly.GenerateSerializerToStream(), System.Xml.Serialization.XmlMapping.IsShallow(), System.Xml.Serialization.DynamicAssemblies.IsTypeDynamic(), System.stream, System.text, System.type, System.SR.XmlMelformMapping, System.SR.XmlPregenOrphanType, and System.SR.XmlPregenTypeDynamic.