static private GenericTypeFor ( IGenericParameterProvider context ) : |
||
context | IGenericParameterProvider | |
리턴 |
static TypeReference GenericTypeFor(IGenericParameterProvider context)
{
var type = context as TypeReference;
if (type != null)
return type.GetElementType ();
var method = context as MethodReference;
if (method != null)
return method.DeclaringType.GetElementType ();
throw new InvalidOperationException ();
}
public TypeReference TypeParameter(string type, int position) { for (int i = this.stack.Count - 1; i >= 0; i--) { TypeReference typeReference = ImportGenericContext.GenericTypeFor(this.stack[i]); if (typeReference.FullName == type) { return(typeReference.GenericParameters[position]); } } throw new InvalidOperationException(); }