Пример #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);
        }
Пример #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);
        }
Пример #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);
        }