예제 #1
0
        public static SingleExecutionCommand FromFunc(Func <object, Task> func, int delayMillisec = DelayMillisec, Func <object, bool> funcCanExecute = null)
        {
            var ret = new SingleExecutionCommand();

            ret._func           = func;
            ret._delayMillisec  = delayMillisec;
            ret._funcCanExucute = funcCanExecute;

            return(ret);
        }
예제 #2
0
        public static SingleExecutionCommand FromFunc <T>(Func <T, Task> func, int delayMillisec = DelayMillisec, Func <object, bool> funcCanExecute = null)
        {
            var ret = new SingleExecutionCommand();

            ret._func = (object obj) =>
            {
                var objT = default(T);
                objT = (T)obj;
                return(func(objT));
            };

            ret._delayMillisec  = delayMillisec;
            ret._funcCanExucute = funcCanExecute;

            return(ret);
        }