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

◆ GetChoiceIdentifierType() [1/2]

Type System.Xml.Serialization.XmlReflectionImporter.GetChoiceIdentifierType ( XmlChoiceIdentifierAttribute choice,
StructModel structModel,
bool isArrayLike,
string accessorName )
inlineprivate

Definition at line 1482 of file XmlReflectionImporter.cs.

1483 {
1484 MemberInfo[] array = structModel.Type.GetMember(choice.MemberName, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
1485 if (array == null || array.Length == 0)
1486 {
1487 PropertyInfo property = structModel.Type.GetProperty(choice.MemberName, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
1488 if (property == null)
1489 {
1491 }
1492 array = new MemberInfo[1] { property };
1493 }
1494 else if (array.Length > 1)
1495 {
1497 }
1498 FieldModel fieldModel = structModel.GetFieldModel(array[0]);
1499 if (fieldModel == null)
1500 {
1502 }
1503 choice.SetMemberInfo(fieldModel.MemberInfo);
1504 Type fieldType = fieldModel.FieldType;
1506 }
static string XmlChoiceIdentiferAmbiguous
Definition SR.cs:1650
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlChoiceIdentiferMemberMissing
Definition SR.cs:1648
Definition SR.cs:7
Type CheckChoiceIdentifierType(Type type, bool isArrayLike, string identifierName, string memberName)

References System.array, System.Xml.Serialization.XmlReflectionImporter.CheckChoiceIdentifierType(), System.SR.Format(), System.SR.XmlChoiceIdentiferAmbiguous, and System.SR.XmlChoiceIdentiferMemberMissing.