我想像这样动态地传递一个void或一个int/string/bool(返回一个值)。
Delay(MyVoid);//I wont to execute a delay here, after the delay it will execute the the param/void like so...
public static void MyVoid()
{
MessageBox.Show("The void has started!");
}
public async Task MyAsyncMethod(void V)
{
await Task.Delay(2000);
V()
}
ps,我尝试过使用 Delegates,但它不允许将其用作参数。