public NoParamsInvoker (object o, MethodInfo method) { if (method.IsStatic) real = (NoParamsDelegate) Delegate.CreateDelegate ( typeof (NoParamsDelegate), method); else real = (NoParamsDelegate) Delegate.CreateDelegate (typeof (NoParamsDelegate), o, method); faked = new EventHandler (InvokeNoParams); }
private static void NoParmsLambda() { // a lambda with no params NoParamsDelegate npd = () => { Console.WriteLine("In the No-params delegate."); return(true); }; Console.WriteLine($"Invoking lambda... return={npd()}"); }
public NoParamsInvoker(object o, MethodInfo method) { if (method.IsStatic) { real = (NoParamsDelegate)Delegate.CreateDelegate( typeof(NoParamsDelegate), method); } else { real = (NoParamsDelegate)Delegate.CreateDelegate(typeof(NoParamsDelegate), o, method); } faked = new EventHandler(InvokeNoParams); }
public NoParamsInvoker (object o, string method) { real = (NoParamsDelegate) Delegate.CreateDelegate ( typeof (NoParamsDelegate), o, method); faked = new EventHandler (InvokeNoParams); }