public abstract SelectProperty ( BindingFlags bindingAttr, Array match, Type returnType, Array indexes, Array modifiers ) : |
||
bindingAttr | BindingFlags | |
match | Array | |
returnType | Type | |
indexes | Array | |
modifiers | Array | |
Résultat |
protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { bool ignoreCase = ((bindingAttr & BindingFlags.IgnoreCase) != 0); PropertyInfo [] props = GetPropertiesByName (name, bindingAttr, ignoreCase, this); int count = props.Length; if (count == 0) return null; if (count == 1 && (types == null || types.Length == 0) && (returnType == null || returnType == props[0].PropertyType)) return props [0]; if (binder == null) binder = Binder.DefaultBinder; return binder.SelectProperty (bindingAttr, props, returnType, types, modifiers); }
public override PropertyInfo SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match, Type returnType, Type[] indexes, ParameterModifier[] modifiers) { return(_binder.SelectProperty(bindingAttr, match, returnType, indexes, modifiers)); }
// Return a property based upon the passed criteria. The nameof the // parameter must be provided. protected override PropertyInfo GetPropertyImpl(String name,BindingFlags bindingAttr,Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { if (binder == null) binder = DefaultBinder; int argCnt = (types != null) ? types.Length : -1; PropertyInfo[] props = GetMatchingProperties(name,bindingAttr,argCnt,null,true); if (props == null) return null; if (argCnt <= 0) { // no arguments if (props.Length == 1) { if (returnType != null && returnType != props[0].PropertyType) return null; return props[0]; } else { if (returnType == null) // if we are here we have no args or property type to select over and we have more than one property with that name throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.Ambiguous")); } } if ((bindingAttr & BindingFlags.ExactBinding) != 0) return System.DefaultBinder.ExactPropertyBinding(props,returnType,types,modifiers); return binder.SelectProperty(bindingAttr,props,returnType,types,modifiers); }
public PropertyInfo GetProperty(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { MemberInfo[] member = this.GetMember(name, bindingAttr); if (member.Length == 1) { return (member[0] as PropertyInfo); } int num = 0; foreach (MemberInfo info in member) { if (info.MemberType == MemberTypes.Property) { num++; } } if (num == 0) { return null; } PropertyInfo[] match = new PropertyInfo[num]; num = 0; foreach (MemberInfo info2 in member) { if (info2.MemberType == MemberTypes.Property) { match[num++] = (PropertyInfo) info2; } } if (binder == null) { binder = JSBinder.ob; } return binder.SelectProperty(bindingAttr, match, returnType, types, modifiers); }
public PropertyInfo GetProperty(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers){ MemberInfo[] members = this.GetMember(name, bindingAttr); if (members.Length == 1) return members[0] as PropertyInfo; int propertyCount = 0; foreach (MemberInfo member in members) if (member.MemberType == MemberTypes.Property) propertyCount++; if (propertyCount == 0) return null; PropertyInfo[] properties = new PropertyInfo[propertyCount]; propertyCount = 0; foreach (MemberInfo member in members) if (member.MemberType == MemberTypes.Property) properties[propertyCount++] = (PropertyInfo)member; if (binder == null) binder = JSBinder.ob; return (PropertyInfo)binder.SelectProperty(bindingAttr, properties, returnType, types, modifiers); }