Defines the current status of a task.
Inheritance: Descriptor
Example #1
0
 ///<summary>
 /// Return from executing a task
 ///</summary>
 ///<param name="finishedtask">Task that finishes</param>
 ///<param name="returns">Result from running the task. </param>
 ///<param name="p">Optional parameters.</param>
 public void Return(ITask finishedtask, TaskResult returns, params object[] p)
 {
     TestManager.Register(TestItemType.Task, finishedtask.Name, new TestAction(returns.ToString()), p);
 }
Example #2
0
        /// <summary>
        /// Provides the method to finish one or more tasks. Also deactivate the task view of <see cref="Task"/> class object.
        /// </summary>
        /// <param name="returntype">The <see cref="TaskResult"/> that defines the current status of a task.</param>
        /// <param name="p">The array of tasks, which will be executed.</param>
        public void Finish(TaskResult returntype, params object[] p)
        {
            this.DeactivateView();

            TaskManager.Return(this, returntype, p);
        }
Example #3
0
        /// <summary>
        /// Provides a method to finish one or more task, after completion of supplied finshed task.
        /// </summary>
        /// <param name="finishedtask">The task which will check for cmpletion.</param>
        /// <param name="returns">The <see cref="TaskResult"/> that defines the current status of a task.</param>
        /// <param name="p">The array of tasks, which will be executed.</param>
        public void Return(ITask finishedtask, TaskResult returns, params object[] p)
        {
            if (finishedtask.Origin == null) return;

            // This only occurs when a task is started with Task.Empty as origin, that is, the starting task
            if (finishedtask.Origin == Task.Empty) finishedtask.Continue(finishedtask.Name, returns, p);

            tasks.Remove(finishedtask.Id);

            MethodInfo continuedirectmethod = finishedtask.Origin.GetType().GetMethod(string.Format("Continue{0}From{1}", returns.Name, finishedtask.Name), p.Select(param => param == null ? typeof(object) : param.GetType()).ToArray());

            if (continuedirectmethod == null)
            {
                finishedtask.Origin.Continue(finishedtask.Name, returns, p);
            }
            else
            {
                continuedirectmethod.Invoke(finishedtask.Origin, p);
            }
        }
Example #4
0
 /// <summary>
 /// Provide a method to continue one or more tasks after completion of specified task.
 /// </summary>
 /// <param name="finishedtask">The task which will check for cmpletion.</param>
 /// <param name="returns">The <see cref="TaskResult"/> that defines the current status of a task.</param>
 /// <param name="p">The array of tasks, which will be executed.</param>
 public virtual void Continue(ApplicationTask finishedtask, TaskResult returns, params object[] p)
 {
     Finish(returns, p);
 }
Example #5
0
 /// <summary>
 /// Provides a method to finish one or more task, after completion of supplied finshed task.
 /// </summary>
 /// <param name="finishedtask">The task which will check for cmpletion.</param>
 /// <param name="returns">The <see cref="TaskResult"/> that defines the current status of a task.</param>
 /// <param name="p">The array of tasks, which will be executed.</param>
 public static void Return(ITask finishedtask, TaskResult returns, params object[] p)
 {
     Provider.Return(finishedtask, returns, p);
 }