コード例 #1
0
        internal static ITaskRuntimeInfo Add(this ITaskRuntimeInfoRepository repository, string pollingQueue)
        {
            ITaskRuntimeInfo result = repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, TaskPriority.Normal, pollingQueue);

            repository.Add(result);

            return(result);
        }
コード例 #2
0
        internal static ITaskRuntimeInfo Add(this ITaskRuntimeInfoRepository repository, TaskPriority priority)
        {
            ITaskRuntimeInfo result = repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, priority, null);

            repository.Add(result);

            return(result);
        }
コード例 #3
0
        internal static ITaskRuntimeInfo Add(this ITaskRuntimeInfoRepository repository)
        {
            ITaskRuntimeInfo result = repository.Create();

            repository.Add(result);

            return(result);
        }
コード例 #4
0
        internal static TTaskRuntimeInfo Add <TTaskRuntimeInfo>(this ITaskRuntimeInfoRepository repository)
            where TTaskRuntimeInfo : ITaskRuntimeInfo
        {
            TTaskRuntimeInfo result = repository.Create <TTaskRuntimeInfo>();

            repository.Add(result);

            return(result);
        }
コード例 #5
0
        /// <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));
        }
コード例 #6
0
 internal static ITaskRuntimeInfo Create(this ITaskRuntimeInfoRepository repository)
 {
     return(repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, TaskPriority.Normal, null));
 }
コード例 #7
0
 internal static TTaskRuntimeInfo Create <TTaskRuntimeInfo>(this ITaskRuntimeInfoRepository repository)
     where TTaskRuntimeInfo : ITaskRuntimeInfo
 {
     return((TTaskRuntimeInfo)repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, TaskPriority.Normal, null));
 }