// constructors /// <summary> /// Initializes a new instance of the <see cref="TaskItem" /> class. /// </summary> /// <param name="recurrence">The recurrence</param> /// <param name="action">The action</param> /// <param name="lifetime">The lifetime</param> public TaskItem(Action<TaskActionParameters> action) { this.status = TaskItemStatus.NotStarted; this.lastRun = DateTimeOffset.MinValue; this.recurrence = Recurrence.Once; this.repeat = 1; this.action = action; this.lifetime = TimeSpan.Zero; this.activeActions = new Collection<TaskActionParameters>(); }
// methods /// <summary> /// Sets recurrence of task item. /// </summary> /// <param name="recurrence">Recurrence</param> /// <returns>Task Item</returns> public TaskItem SetRecurrence(Recurrence recurrence) { this.Recurrence = recurrence; return this; }