SHARE
TWEET

Untitled

apieceoffruit May 28th, 2020 1,018 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.     public static class ReflectionExtensions
  3.     {
  4.         public static void RunMethod(this object o,string method) => o.Run(o.GetMethod(method));
  5.  
  6.         public static MethodInfo GetMethod(this  object o,string methodName)=>o.GetType()
  7.             .GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance);
  8.        
  9.         public static void Run(this MethodInfo info,object o)=>info.Invoke(o,new object[]{});
  10.         public static void Run(this object o,MethodInfo info)=>info.Invoke(o,new object[]{});
  11.        
  12.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top