Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
pluginbase.Objects.Tasks.ChainedTask Class Reference
Inheritance diagram for pluginbase.Objects.Tasks.ChainedTask:
pluginbase.Objects.Tasks.ITask

Public Member Functions

ChainedTask Then (ITask task)
 Add a task to run after the current set of tasks More...
 
ChainedTask Promise (Action< Exception > action)
 Promise the specified action. More...
 

Static Public Member Functions

static ChainedTask Chain (params ITask[] tasks)
 
static ChainedTask Create ()
 

Additional Inherited Members

- Properties inherited from pluginbase.Objects.Tasks.ITask
TimeSpan Frequency [get]
 

Member Function Documentation

static ChainedTask pluginbase.Objects.Tasks.ChainedTask.Chain ( params ITask[]  tasks)
static

Attribute: 0

as ChainedTask;

Attribute: i

);

16  {
17  if (tasks.Length == 0)
18  {
19  throw new ArgumentException("Tasks");
20  }
21 
22  ChainedTask chain = tasks[0] as ChainedTask;
23  if (chain != null && chain._promises.Count == 0) //Can't add after a promise
24  {
25  //Append to an existing chained task
26  for (int i=1; i<tasks.Length; ++i)
27  chain.Then(tasks [i]);
28  }
29  else
30  {
31  //Create a new chained task
32  chain = new ChainedTask();
33  foreach (var task in tasks)
34  chain.Then(task);
35  }
36  return chain;
37  }
static ChainedTask pluginbase.Objects.Tasks.ChainedTask.Create ( )
static
40  {
41  return new ChainedTask();
42  }
ChainedTask pluginbase.Objects.Tasks.ChainedTask.Promise ( Action< Exception >  action)

Promise the specified action.

Parameters
actionAction.
59  {
60  _promises.AddLast(action);
61  return this;
62  }
ChainedTask pluginbase.Objects.Tasks.ChainedTask.Then ( ITask  task)

Add a task to run after the current set of tasks

Parameters
taskTask.
49  {
50  _chain.AddLast(task);
51  return this;
52  }

The documentation for this class was generated from the following file: