public static PropertyInfo ExactPropertyBinding(PropertyInfo[] match,Type returnType,Type[] types,ParameterModifier[] modifiers)
{
if (match==null)
throw new ArgumentNullException("match");
PropertyInfo bestMatch = null;
int typesLength = (types != null) ? types.Length : 0;
for (int i=0;i<match.Length;i++) {
ParameterInfo[] par = match[i].GetIndexParameters();
int j;
for (j=0;j<typesLength;j++) {
Type pCls = par[j].ParameterType;
// If the classes exactly match continue
if (pCls != types[j])
break;
}
if (j < typesLength)
continue;
if (returnType != null && returnType != match[i].PropertyType)
continue;
if (bestMatch != null)
throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.Ambiguous"));
bestMatch = match[i];
}
return bestMatch;
}