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

◆ ImportMemberMapping()

MemberMapping System.Xml.Serialization.XmlReflectionImporter.ImportMemberMapping ( XmlReflectionMember xmlReflectionMember,
string ns,
XmlReflectionMember[] xmlReflectionMembers,
bool rpc,
bool openModel,
RecursionLimiter limiter )
inlineprivate

Definition at line 1338 of file XmlReflectionImporter.cs.

1339 {
1341 XmlAttributes xmlAttributes = xmlReflectionMember.XmlAttributes;
1342 TypeDesc typeDesc = _typeScope.GetTypeDesc(xmlReflectionMember.MemberType);
1343 if (xmlAttributes.XmlFlags == (XmlAttributeFlags)0)
1344 {
1345 if (typeDesc.IsArrayLike)
1346 {
1347 XmlArrayAttribute xmlArrayAttribute = CreateArrayAttribute(typeDesc);
1352 }
1353 else
1354 {
1356 if (typeDesc.IsStructLike)
1357 {
1358 XmlAttributes xmlAttributes2 = new XmlAttributes(xmlReflectionMember.MemberType);
1359 if (xmlAttributes2.XmlRoot != null)
1360 {
1361 if (xmlAttributes2.XmlRoot.ElementName.Length > 0)
1362 {
1363 xmlElementAttribute.ElementName = xmlAttributes2.XmlRoot.ElementName;
1364 }
1365 if (rpc)
1366 {
1368 if (xmlAttributes2.XmlRoot.GetIsNullableSpecified())
1369 {
1371 }
1372 }
1373 else
1374 {
1377 }
1378 }
1379 }
1380 if (xmlElementAttribute.ElementName.Length == 0)
1381 {
1383 }
1384 if (xmlElementAttribute.Namespace == null && !rpc)
1385 {
1387 }
1390 }
1391 }
1392 else if (xmlAttributes.XmlRoot != null)
1393 {
1394 CheckNullable(xmlAttributes.XmlRoot.IsNullable, typeDesc, null);
1395 }
1396 MemberMapping memberMapping = new MemberMapping();
1400 memberMapping.CheckShouldPersist = fieldModel.CheckShouldPersist;
1404 if (xmlAttributes.XmlChoiceIdentifier != null)
1405 {
1407 }
1409 if (xmlReflectionMember.OverrideIsNullable && memberMapping.Elements.Length != 0)
1410 {
1411 memberMapping.Elements[0].IsNullable = false;
1412 }
1413 return memberMapping;
1414 }
void Add(TKey key, TValue value)
TypeDesc GetTypeDesc(string name, string ns)
Definition TypeScope.cs:224
static void CheckNullable(bool isNullable, TypeDesc typeDesc, TypeMapping mapping)
static XmlReflectionMember FindSpecifiedMember(string memberName, XmlReflectionMember[] reflectionMembers)
void ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, string ns, Type choiceIdentifierType, bool rpc, bool openModel, RecursionLimiter limiter)
static XmlElementAttribute CreateElementAttribute(TypeDesc typeDesc)
Type GetChoiceIdentifierType(XmlChoiceIdentifierAttribute choice, XmlReflectionMember[] xmlReflectionMembers, bool isArrayLike, string accessorName)
static XmlArrayAttribute CreateArrayAttribute(TypeDesc typeDesc)

References System.Xml.Serialization.XmlReflectionImporter._typeScope, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Serialization.XmlReflectionImporter.CheckNullable(), System.Xml.Serialization.XmlReflectionImporter.CreateArrayAttribute(), System.Xml.Serialization.XmlReflectionImporter.CreateElementAttribute(), System.Xml.Dictionary, System.Xml.Serialization.XmlReflectionImporter.FindSpecifiedMember(), System.Xml.Serialization.XmlReflectionImporter.GetChoiceIdentifierType(), System.Xml.Serialization.TypeScope.GetTypeDesc(), and System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping().

Referenced by System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping().