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

◆ SetResourceAccessorByPropertyLookup()

void System.ComponentModel.DataAnnotations.ValidationAttribute.SetResourceAccessorByPropertyLookup ( )
inlineprivate

Definition at line 135 of file ValidationAttribute.cs.

136 {
138 if (property != null)
139 {
140 MethodInfo getMethod = property.GetMethod;
141 if (getMethod == null || (!getMethod.IsAssembly && !getMethod.IsPublic))
142 {
143 property = null;
144 }
145 }
146 if (property == null)
147 {
149 }
150 if (property.PropertyType != typeof(string))
151 {
153 }
154 _errorMessageResourceAccessor = () => (string)property.GetValue(null, null);
155 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ValidationAttribute_ResourceTypeDoesNotHaveProperty
Definition SR.cs:112
static string ValidationAttribute_ResourcePropertyNotStringType
Definition SR.cs:110
Definition SR.cs:7
PropertyInfo? GetProperty(string name)
Definition Type.cs:815
string? FullName
Definition Type.cs:47

References System.ComponentModel.DataAnnotations.ValidationAttribute._errorMessageResourceAccessor, System.ComponentModel.DataAnnotations.ValidationAttribute._errorMessageResourceName, System.ComponentModel.DataAnnotations.ValidationAttribute._errorMessageResourceType, System.SR.Format(), System.Type.FullName, System.Type.GetProperty(), System.Reflection.MethodBase.IsAssembly, System.Reflection.MethodBase.IsPublic, System.SR.ValidationAttribute_ResourcePropertyNotStringType, and System.SR.ValidationAttribute_ResourceTypeDoesNotHaveProperty.

Referenced by System.ComponentModel.DataAnnotations.ValidationAttribute.SetupResourceAccessor().