public static SingleExecutionCommand FromFunc(Func <object, Task> func, int delayMillisec = 400) { var ret = new SingleExecutionCommand(); ret._func = func; ret._delayMillisec = delayMillisec; return(ret); }
public static SingleExecutionCommand FromFunc(Func <Task> func, int delayMillisec = 400) { var ret = new SingleExecutionCommand(); ret._func = (obj) => { return(func()); }; ret._delayMillisec = delayMillisec; return(ret); }
public static SingleExecutionCommand FromFunc <T>(Func <T, Task> func, int delayMillisec = 400) { var ret = new SingleExecutionCommand(); ret._func = (object obj) => { var objT = default(T); objT = (T)obj; return(func(objT)); }; ret._delayMillisec = delayMillisec; return(ret); }