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

◆ WritePrimitiveValue()

void System.Xml.Serialization.XmlSerializationWriterILGen.WritePrimitiveValue ( TypeDesc typeDesc,
SourceInfo source,
out Type returnType )
inlineprivate

Definition at line 132 of file XmlSerializationWriterILGen.cs.

133 {
134 if (typeDesc == base.StringTypeDesc || typeDesc.FormatterName == "String")
135 {
136 source.Load(typeDesc.Type);
137 returnType = typeDesc.Type;
138 }
139 else if (!typeDesc.HasCustomFormatter)
140 {
141 Type type = typeDesc.Type;
142 if (type == typeof(byte))
143 {
144 type = typeof(short);
145 }
146 else if (type == typeof(ushort))
147 {
148 type = typeof(int);
149 }
150 MethodInfo method = typeof(XmlConvert).GetMethod("ToString", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, new Type[1] { type });
151 source.Load(typeDesc.Type);
152 ilg.Call(method);
153 returnType = method.ReturnType;
154 }
155 else
156 {
158 if (typeDesc.FormatterName == "XmlQualifiedName")
159 {
161 ilg.Ldarg(0);
162 }
163 MethodInfo method2 = typeof(XmlSerializationWriter).GetMethod("From" + typeDesc.FormatterName, bindingAttr, new Type[1] { typeDesc.Type });
164 source.Load(typeDesc.Type);
166 returnType = method2.ReturnType;
167 }
168 }
void Call(MethodInfo methodInfo)

References System.Xml.Serialization.CodeGenerator.Call(), System.Xml.Dictionary, System.Xml.Serialization.XmlSerializationILGen.ilg, System.Xml.Serialization.CodeGenerator.Ldarg(), System.source, and System.type.

Referenced by System.Xml.Serialization.XmlSerializationWriterILGen.WriteMember(), System.Xml.Serialization.XmlSerializationWriterILGen.WritePrimitive(), and System.Xml.Serialization.XmlSerializationWriterILGen.WriteText().