public void RemovedFromScheduler() { groupTag = null; job = null; jobRepeat = null; noMoreTasks = false; iterativeMode = false; node = null; for (LinkedListNode <SingleTask> task = tasks.First; task != null; task = task.Next) { task.Value.RemovedFromScheduler(); } for (LinkedListNode <SingleTask> taskNode = tasks.First; taskNode != null; taskNode = taskNode.Next) { ReturnNode(taskNode); } tasks.Clear(); SuperInvokePoolHolder.PoolManager.ReturnInstance <Sequence>(this); }
private static IJobRepeat ActualRunRepeat(Action method, string tag, RepeatSettings repeatSettings) { CheckMethod(method); CheckDelay(repeatSettings.delay); JobRepeat jobRepeat = null; if (repeatSettings.repeats == INFINITY || repeatSettings.repeats > 0) //if repeats == 0 it does nothing { jobRepeat = new JobRepeat() { TotalRepeatsNumber = repeatSettings.repeats }; Sequence sequence = Sequence.MakeInstance(); sequence.SetGroupTag(SuperInvokeTag.GetInstance(tag)); sequence.AddSingleTask(SingleTask.MakeInstance(method, 0, tag)); sequence.SetIterativeMode(repeatSettings); sequence.SetJob(jobRepeat); ScheduleBridge.Schedule(sequence); } return(jobRepeat); }
public void SetJob(IJob job) { this.job = (Job)job; if (job is JobRepeat) { jobRepeat = (JobRepeat)job; } }