예제 #1
0
        public static Task DispatchAsync(this CefTaskRunner @this, Action actionToRun)
        {
            var actiontask = new CefTask_Action(actionToRun);

            @this.PostTask(actiontask);
            return(actiontask.Task);
        }
예제 #2
0
        public static Task <T> EvaluateAsync <T>(this CefTaskRunner @this, Func <T> evaluate)
        {
            if (@this.BelongsToCurrentThread)
            {
                return(Task.FromResult(evaluate()));
            }

            var functionTask = new FunctionTask <T>(evaluate);

            @this.PostTask(functionTask);
            return(functionTask.Task);
        }
예제 #3
0
        public static Task RunAsync(this CefTaskRunner @this, Action actionToRun)
        {
            if (@this.BelongsToCurrentThread)
            {
                actionToRun();
                return(TaskHelper.Ended());
            }

            var actiontask = new CefTask_Action(actionToRun);

            @this.PostTask(actiontask);
            return(actiontask.Task);
        }
예제 #4
0
        public static Task RunAsync(this CefTaskRunner @this, Action actionToRun)
        {
            if (@this.BelongsToCurrentThread)
            {
                actionToRun();
                return(Task.FromResult <object>(null));
            }

            var actiontask = new CefTask_Action(actionToRun);

            @this.PostTask(actiontask);
            return(actiontask.Task);
        }