コード例 #1
0
 public static MethodInfoEx GetMethodEx(this MethodInfo methodInfo, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(MethodInfoExCache.GetMethodEx(methodInfo));
     }
     else
     {
         return(new MethodInfoEx(methodInfo, false));
     }
 }
コード例 #2
0
 public static MethodInfoEx GetMethodEx(this Type type, string name, IEnumerable <Type> signature, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(MethodInfoExCache.GetMethodEx(type, name, signature, bindingFlags));
     }
     else
     {
         var f = (signature == null) ? type.GetMethod(name, bindingFlags) : type.GetMethod(name, bindingFlags, null, signature.ToArray(), null);
         if (f == null)
         {
             return(null);
         }
         return(new MethodInfoEx(f, false));
     }
 }