예제 #1
0
 public static AsyncActionUpdate Create(PlaceholderAction placeholder, ActionPriority priority, Func <ActionUpdateResult> task)
 {
     return(new AsyncActionUpdate(placeholder, priority,
                                  Task.Run <ActionUpdateResult>(() =>
     {
         return task();
     })
                                  ));
 }
예제 #2
0
        private AsyncActionUpdate(PlaceholderAction placeholder, ActionPriority priority, Task <ActionUpdateResult> updateTask)
        {
            if (placeholder == null)
            {
                throw new ArgumentNullException(nameof(placeholder));
            }

            Priority    = priority;
            Placeholder = placeholder;
            UpdateTask  = updateTask;
            if (UpdateTask.Status == TaskStatus.Created)
            {
                UpdateTask.Start();
            }
        }
예제 #3
0
 public static AsyncActionUpdate Create(PlaceholderAction placeholder, ActionPriority priority, Func <Task <ActionUpdateResult> > task)
 {
     return(new AsyncActionUpdate(placeholder, priority, task()));
 }