public static MethodBase ExactBinding(MethodBase[] match,Type[] types,ParameterModifier[] modifiers)
{
if (match==null)
throw new ArgumentNullException("match");
MethodBase[] aExactMatches = new MethodBase[match.Length];
int cExactMatches = 0;
for (int i=0;i<match.Length;i++) {
ParameterInfo[] par = match[i].GetParametersNoCopy();
if (par.Length == 0) {
continue;
}
int j;
for (j=0;j<types.Length;j++) {
Type pCls = par[j]. ParameterType;
// If the classes exactly match continue
if (!pCls.Equals(types[j]))
break;
}
if (j < types.Length)
continue;
// Add the exact match to the array of exact matches.
aExactMatches[cExactMatches] = match[i];
cExactMatches++;
}
if (cExactMatches == 0)
return null;
if (cExactMatches == 1)
return aExactMatches[0];
return FindMostDerivedNewSlotMeth(aExactMatches, cExactMatches);
}