/// <summary> ///If field is an Action<> there is no problem ///but if field is Func<> then that means that ///for int Foo(bool,string) it would be something ///like int,bool,string and to find foo we would need to do GetMethod("Foo",,{ bool,string} ); /// </summary> /// <param name="field">field containing delegate inside a DisplayClass</param> /// <returns></returns> private static Type[] ExtractParameterTypesForDelegateInField(FieldInfo field) { var parameterTypes = field.FieldType.GetGenericArguments(); if (TypeCacheUtils.IsFuncType(field.FieldType)) { var res = new Type[parameterTypes.Length - 1]; Array.Copy(parameterTypes, 0, res, 0, res.Length); parameterTypes = res; } return(parameterTypes); }