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

◆ GetPropertyImpl() [1/2]

override PropertyInfo System.RuntimeType.GetPropertyImpl ( string name,
BindingFlags bindingAttr,
Binder binder,
Type returnType,
Type[] types,
ParameterModifier[] modifiers )
inlineprotected

Definition at line 2447 of file RuntimeType.cs.

2448 {
2449 if (name == null)
2450 {
2451 throw new ArgumentNullException("name");
2452 }
2454 if (propertyCandidates.Count == 0)
2455 {
2456 return null;
2457 }
2458 if (types == null || types.Length == 0)
2459 {
2460 if (propertyCandidates.Count == 1)
2461 {
2462 PropertyInfo propertyInfo = propertyCandidates[0];
2463 if ((object)returnType != null && !returnType.IsEquivalentTo(propertyInfo.PropertyType))
2464 {
2465 return null;
2466 }
2467 return propertyInfo;
2468 }
2469 if ((object)returnType == null)
2470 {
2471 throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
2472 }
2473 }
2474 if ((bindingAttr & BindingFlags.ExactBinding) != 0)
2475 {
2477 }
2478 if (binder == null)
2479 {
2480 binder = Type.DefaultBinder;
2481 }
2482 return binder.SelectProperty(bindingAttr, propertyCandidates.ToArray(), returnType, types, modifiers);
2483 }
static PropertyInfo ExactPropertyBinding(PropertyInfo[] match, Type returnType, Type[] types, ParameterModifier[] modifiers)
ListBuilder< PropertyInfo > GetPropertyCandidates(string name, BindingFlags bindingAttr, Type[] types, bool allowPrefixLookup)

References System.SR.Arg_AmbiguousMatchException, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Type.DefaultBinder, System.DefaultBinder.ExactPropertyBinding(), System.RuntimeType.GetPropertyCandidates(), and System.Reflection.PropertyInfo.PropertyType.