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

◆ GetPropertyModel()

FieldModel System.Xml.Serialization.StructModel.GetPropertyModel ( PropertyInfo propertyInfo)
inlineprivate

Definition at line 93 of file StructModel.cs.

94 {
95 if (propertyInfo.DeclaringType != base.Type)
96 {
97 return null;
98 }
99 if (CheckPropertyRead(propertyInfo))
100 {
101 TypeDesc typeDesc = base.ModelScope.TypeScope.GetTypeDesc(propertyInfo.PropertyType, propertyInfo, directReference: true, throwOnError: false);
102 if (!propertyInfo.CanWrite && typeDesc.Kind != TypeKind.Collection && typeDesc.Kind != TypeKind.Enumerable)
103 {
104 return null;
105 }
106 CheckSupportedMember(typeDesc, propertyInfo, propertyInfo.PropertyType);
107 return new FieldModel(propertyInfo, propertyInfo.PropertyType, typeDesc);
108 }
109 return null;
110 }
static bool CheckPropertyRead(PropertyInfo propertyInfo)
void CheckSupportedMember(TypeDesc typeDesc, MemberInfo member, Type type)

References System.Reflection.PropertyInfo.CanWrite, System.Xml.Serialization.StructModel.CheckPropertyRead(), System.Xml.Serialization.StructModel.CheckSupportedMember(), System.Reflection.MemberInfo.DeclaringType, System.Xml.Dictionary, and System.Reflection.PropertyInfo.PropertyType.

Referenced by System.Xml.Serialization.StructModel.GetFieldModel().