Skip to content

Commit

Permalink
Default schedule names to the type name when adding schedules as gene…
Browse files Browse the repository at this point in the history
…ric types. Fixes #44.
  • Loading branch information
jgeurts committed Jun 11, 2014
1 parent e6bac58 commit 6cfe5ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions FluentScheduler/Registry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public Schedule Schedule<T>() where T : ITask
{
Schedules.Add(schedule);
}
schedule.Name = typeof(T).Name;
return schedule;
}

Expand Down
5 changes: 4 additions & 1 deletion FluentScheduler/TaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ public static void AddTask<T>(Action<Schedule> taskSchedule) where T : ITask
if (taskSchedule == null)
throw new ArgumentNullException("taskSchedule", "Please specify the task schedule to add to the task manager.");

var schedule = new Schedule(TaskFactory.GetTaskInstance<T>());
var schedule = new Schedule(TaskFactory.GetTaskInstance<T>())
{
Name = typeof (T).Name
};
AddTask(taskSchedule, schedule);
}

Expand Down

0 comments on commit 6cfe5ea

Please sign in to comment.