Exemplo n.º 1
0
		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);
		}
Exemplo n.º 2
0
        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()}");
        }
Exemplo n.º 3
0
 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);
		}