Ejemplo n.º 1
0
        public static SingleExecutionCommand FromFunc(Func <object, Task> func, int delayMillisec = 400)
        {
            var ret = new SingleExecutionCommand();

            ret._func          = func;
            ret._delayMillisec = delayMillisec;
            return(ret);
        }
Ejemplo n.º 2
0
        public static SingleExecutionCommand FromFunc(Func <Task> func, int delayMillisec = 400)
        {
            var ret = new SingleExecutionCommand();

            ret._func = (obj) =>
            {
                return(func());
            };
            ret._delayMillisec = delayMillisec;
            return(ret);
        }
Ejemplo n.º 3
0
        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);
        }