Exemple #1
0
 /// <summary>
 /// Does the state of the on runtime.
 /// </summary>
 /// <param name="state">The state.</param>
 private void DoOnRuntimeState(ManagerRuntimeStates state)
 {
     ManagerRuntimeState = state;
     if (OnRuntimeState != null)
     {
         OnRuntimeState(state);
     }
 }
Exemple #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>
        /// <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();
        }