12 internal class MethodCacheKey
14 public string TypeName {
get;
private set; }
15 public string MethodName {
get;
private set; }
16 public Type[] ParamTypes {
get;
private set; }
19 public MethodCacheKey(
string typeName,
string methodName, Type[] paramTypes)
21 this.TypeName = typeName;
22 this.MethodName = methodName;
23 this.ParamTypes = paramTypes;
25 _hashKey = typeName.GetHashCode();
26 _hashKey = _hashKey ^ methodName.GetHashCode();
27 foreach (Type item
in paramTypes)
29 _hashKey = _hashKey ^ item.Name().GetHashCode();
31 _hashKey = _hashKey ^ item.Name.GetHashCode();
35 public override bool Equals(
object obj)
37 MethodCacheKey key = obj as MethodCacheKey;
39 key.TypeName ==
this.TypeName &&
40 key.MethodName ==
this.MethodName &&
41 ArrayEquals(key.ParamTypes,
this.ParamTypes))
47 private bool ArrayEquals(Type[] a1, Type[] a2)
49 if (a1.Length != a2.Length)
52 for (
int pos = 0; pos < a1.Length; pos++)
53 if (a1[pos] != a2[pos])
58 public override int GetHashCode()