void RequireParameters() { if (parameterTypes == null) { ParameterInfo[] pis = pi.GetIndexParameters(); parameterTypes = ArrayUtils.GetTypes(pis); hasVar = pis.Length > 0 && pis[pis.Length - 1].GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0; } }
void RequireParameters() { if (_parameterTypes == null) { ParameterInfo[] pis = _pi.GetIndexParameters(); _parameterTypes = ArrayUtils.GetTypes(pis); _hasVar = pis.Length > 0 && Helpers.GetCustomAttributes(pis[pis.Length - 1], typeof(ParamArrayAttribute), false, _.TypeMapper).Count > 0; } }
public ApplicableFunction FindMethod(MethodInfo method) { var t = method.ReflectedType; foreach (Type type in SearchableTypes(t)) { IEnumerable <IMemberInfo> methods = GetMethods(type); IEnumerable <IMemberInfo> filter = Filter(methods, method.Name, false, method.IsStatic, !type.IsValueType); ApplicableFunction af = OverloadResolver.ResolveStrict(filter, TypeMapper, ArrayUtils.GetTypes(method.GetParameters())); if (af != null) { return(af); } } throw new MissingMethodException(Properties.Messages.ErrMissingMethod + ": " + method.ToString()); }