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

◆ GetArraySource() [2/2]

string System.Xml.Serialization.XmlSerializationReaderCodeGen.GetArraySource ( TypeDesc typeDesc,
string arrayName,
bool multiRef )
inlineprivate

Definition at line 2390 of file XmlSerializationReaderCodeGen.cs.

2391 {
2392 string text = "c" + arrayName;
2393 string text2 = "";
2394 if (multiRef)
2395 {
2396 text2 = "soap = (System.Object[])EnsureArrayIndex(soap, " + text + "+2, typeof(System.Object)); ";
2397 }
2398 bool useReflection = typeDesc.UseReflection;
2399 if (typeDesc.IsArray)
2400 {
2401 string cSharpName = typeDesc.ArrayElementTypeDesc.CSharpName;
2402 bool useReflection2 = typeDesc.ArrayElementTypeDesc.UseReflection;
2403 string text3 = (useReflection ? "" : ("(" + cSharpName + "[])"));
2404 text2 = text2 + arrayName + " = " + text3 + "EnsureArrayIndex(" + arrayName + ", " + text + ", " + base.RaCodeGen.GetStringForTypeof(cSharpName, useReflection2) + ");";
2405 string stringForArrayMember = base.RaCodeGen.GetStringForArrayMember(arrayName, text + "++", typeDesc);
2406 if (multiRef)
2407 {
2408 text2 = text2 + " soap[1] = " + arrayName + ";";
2409 text2 = text2 + " if (ReadReference(out soap[" + text + "+2])) " + stringForArrayMember + " = null; else ";
2410 }
2411 return text2 + stringForArrayMember;
2412 }
2413 return base.RaCodeGen.GetStringForMethod(arrayName, typeDesc.CSharpName, "Add", useReflection);
2414 }

References System.Xml.Dictionary, and System.text.