static IMethod GetDeclaration (IType type, IMethod method)
{
foreach (IMethod cur in type.Methods) {
if (cur.Name == method.Name && cur.Parameters.Count == method.Parameters.Count) {
bool equal = true;
for (int i = 0; i < cur.Parameters.Count; i++) {
if (cur.Parameters[i].ReturnType.ToInvariantString () != method.Parameters[i].ReturnType.ToInvariantString ()) {
equal = false;
break;
}
}
if (equal)
return cur;
}
}
return null;
}