Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkManager"/> class.
        /// </summary>
        /// <param name="registry">The registry.</param>
        /// <param name="resolver">The resolver.</param>
        /// <param name="notifier">The notifier.</param>
        public WorkManager(WorkManagerRegistry registry, IWorkManagerDependencyResolver resolver, Notification notifier)
        {
            _threadWatcher  = new ThreadWatcher(this);
            _messageManager = new MessageManager(this);
            _workers        = new List <IBaseWorker>();

            _workManagerRegistry = registry;
            _workManagerRegistry.DependencyResolver = resolver;

            Disposed            = false;
            ManagerRuntimeState = ManagerRuntimeStates.Stopped;
            Notification        = notifier ?? new WorkManagerNotification();
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkManager"/> class.
 /// </summary>
 /// <param name="registry">The registry.</param>
 /// <param name="resolver">The resolver.</param>
 public WorkManager(WorkManagerRegistry registry, IWorkManagerDependencyResolver resolver) : this(registry, resolver, null)
 {
 }