/// <summary> /// Gets task job settings for task type. /// </summary> /// <typeparam name="TTask">The type of the task.</typeparam> /// <param name="repository">The repository to extend.</param> /// <returns>Task job settings for the specified task type, or null if not found.</returns> /// <exception cref="ArgumentNullException">Parameter <paramref name="repository"/> is null.</exception> public static ITaskJobSettings Get <TTask>(this ITaskJobSettingsRepository repository) where TTask : ITask { if (repository == null) { throw new ArgumentNullException(nameof(repository)); } return(repository.Get(typeof(TTask))); }
/// <summary> /// Sets task job settings for task type. /// </summary> /// <typeparam name="TTask">The type of the task.</typeparam> /// <param name="repository">The repository to extend.</param> /// <param name="settings">The settings to set for the specified task type.</param> /// <exception cref="ArgumentNullException">Parameter <paramref name="repository"/> or <paramref name="settings" /> is null.</exception> public static void Set <TTask>(this ITaskJobSettingsRepository repository, ITaskJobSettings settings) where TTask : ITask { if (repository == null) { throw new ArgumentNullException(nameof(repository)); } repository.Set(typeof(TTask), settings); }
/// <summary> /// Clears the task job settings for task type. /// </summary> /// <typeparam name="TTask">The type of the task.</typeparam> /// <param name="repository">The repository to extend.</param> /// <exception cref="ArgumentNullException">Parameter <paramref name="repository"/> is null.</exception> public static void Clear <TTask>(this ITaskJobSettingsRepository repository) where TTask : ITask { if (repository == null) { throw new ArgumentNullException(nameof(repository)); } repository.Clear(typeof(TTask)); }
/// <summary> /// Initializes a new instance of the <see cref="TaskProcessorRepository"/> class. /// </summary> /// <param name="tasksRepository">The tasks repository.</param> /// <param name="taskRuntimeInfoRepository">The task runtime information repository.</param> /// <param name="taskProcessorsRepository">The task processor runtime information repository.</param> /// <param name="taskSummaryRepository">The task summary repository.</param> /// <param name="taskJobSettingsRepository">The task job settings repository.</param> /// <param name="scheduledTasksRepository">The scheduled tasks repository.</param> /// <exception cref="ArgumentNullException">Parameter <paramref name="tasksRepository"/>, /// <paramref name="taskRuntimeInfoRepository"/>, <paramref name="taskProcessorsRepository"/>, <paramref name="taskProcessorsRepository"/> /// <paramref name="taskJobSettingsRepository"/> or <paramref name="scheduledTasksRepository"/> is null.</exception> protected TaskProcessorRepository( ITaskRepository tasksRepository, ITaskRuntimeInfoRepository taskRuntimeInfoRepository, ITaskProcessorRuntimeInfoRepository taskProcessorsRepository, ITaskSummaryRepository taskSummaryRepository, ITaskJobSettingsRepository taskJobSettingsRepository, IScheduledTaskRepository scheduledTasksRepository) { Trace.WriteLine("ENTER: Constructing '{0}' ...".FormatInvariant(this.GetType().Name)); if (tasksRepository == null) { throw new ArgumentNullException("tasksRepository"); } if (taskRuntimeInfoRepository == null) { throw new ArgumentNullException("taskRuntimeInfoRepository"); } if (taskProcessorsRepository == null) { throw new ArgumentNullException("taskProcessorsRepository"); } if (taskSummaryRepository == null) { throw new ArgumentNullException("taskSummaryRepository"); } if (taskJobSettingsRepository == null) { throw new ArgumentNullException("taskJobSettingsRepository"); } if (scheduledTasksRepository == null) { throw new ArgumentNullException("scheduledTasksRepository"); } this.tasks = tasksRepository; this.taskRuntimeInfo = taskRuntimeInfoRepository; this.taskProcessors = taskProcessorsRepository; this.taskSummary = taskSummaryRepository; this.taskJobSettings = taskJobSettingsRepository; this.scheduledTasks = scheduledTasksRepository; Trace.WriteLine("ENTER: Constructing '{0}' ...".FormatInvariant(this.GetType().Name)); }