/// <summary>
 /// Makes a reference to a method in a closed generic type.
 /// </summary>
 public static MethodReference FromDeclaringType(this MethodReference method,
                                                 TypeReference closedType)
 {
     return(method.CloseDeclaringType(
                ((GenericInstanceType)closedType).GenericArguments.ToArray()));
 }