Empeld
Empeld plugin documentation.
pluginbase.Objects.Tasks.RecurringTask Class Reference

Recurring task. Returns true once done More...

Inheritance diagram for pluginbase.Objects.Tasks.RecurringTask:
pluginbase.Objects.Tasks.ITask

Public Member Functions

 RecurringTask (Func< TaskResult > method, TimeSpan frequency)
 
 RecurringTask (Action task, TimeSpan frequency)
 
TaskResult InvokeTask (long maxMilliseconds)
 
override string ToString ()
 

Properties

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

Detailed Description

Recurring task. Returns true once done

Constructor & Destructor Documentation

◆ RecurringTask() [1/2]

pluginbase.Objects.Tasks.RecurringTask.RecurringTask ( Func< TaskResult method,
TimeSpan  frequency 
)
13  {
14  _method = method;
15  Frequency = frequency;
16  }
TimeSpan Frequency
Definition: RecurringTask.cs:33

◆ RecurringTask() [2/2]

pluginbase.Objects.Tasks.RecurringTask.RecurringTask ( Action  task,
TimeSpan  frequency 
)
19  {
20  Frequency = frequency;
21  _method = () => {
22  task();
23  return TaskResult.Continue;
24  };
25  }
TimeSpan Frequency
Definition: RecurringTask.cs:33
TaskResult
The result of a scheduled task
Definition: TaskResult.cs:8

Member Function Documentation

◆ InvokeTask()

TaskResult pluginbase.Objects.Tasks.RecurringTask.InvokeTask ( long  maxMilliseconds)

Implements pluginbase.Objects.Tasks.ITask.

29  {
30  return _method();
31  }

◆ ToString()

override string pluginbase.Objects.Tasks.RecurringTask.ToString ( )
38  {
39  return string.Format("[RecurringTask: Frequency={0}, {1}]", Frequency, _method.Method.Name);
40  }
TimeSpan Frequency
Definition: RecurringTask.cs:33

Property Documentation

◆ Frequency

TimeSpan pluginbase.Objects.Tasks.RecurringTask.Frequency
get

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