public FieldProxy(IType instance, IField field) { if (instance == null) { throw new ArgumentNullException("instance"); } if (field == null) { throw new ArgumentNullException("field"); } _instance = instance; _field = field; _type = GenericType.Resolve(instance, field.Type); }
public static IMethod FindOverrideMethod(this IType type, IMethod method) { if (method.IsGenericInstance) { var gm = method.InstanceOf; var m = type.FindSameMethod(gm, false); if (m == null) { return(null); } m = GenericType.CreateMethodInstance(type, m, method.GenericArguments); if (m == null) { throw new InvalidOperationException(); } return(m); } return(type.FindSameMethod(method, false)); }
private IMethod ResolveMethod(IMethod method) { if (method == null) { return(null); } var declType = GenericType.Resolve(_instance, this, method.DeclaringType); if (declType.IsGenericInstance()) { var m = GenericType.FindMethodProxy(declType, method); if (m == null) { throw new InvalidOperationException(); } return(m); } return(method); }
private IEnumerable <IParameter> Populate() { return(_source.Select(p => (IParameter) new ParameterProxy(p, GenericType.Resolve(_contextType, _contextMethod, p.Type)))); }