public TaskManager(Object parent, TaskScheduler scheduler) { _parent = parent; Scheduler = scheduler; _runningTasks = 0; ReadyState = new ReadyNotifier(_parent); }
/// <summary> /// Creates a new AbstractFileMonitor with the default archive and a collection of /// non-default archives that should be registered /// </summary> /// <param name="baseDirectory">The folder where this monitor stores it archives</param> /// <param name="defaultArchive">The default archive</param> /// <param name="otherArchives">A list of other archives that should be registered via see /// cref="RegisterArchive(IArchive)"/></param> protected AbstractFileMonitor(string baseDirectory, AbstractArchive defaultArchive, params AbstractArchive[] otherArchives) { this.MonitorStoragePath = baseDirectory; this.registeredArchives = new HashSet<AbstractArchive>(); this.archiveMap = new Dictionary<string, AbstractArchive>(StringComparer.OrdinalIgnoreCase); this.ReadyState = new ReadyNotifier(this); this.numberOfWorkingArchives = 0; Factory = Task.Factory; if(null != defaultArchive) { RegisterArchive(defaultArchive, true); } foreach(var archive in otherArchives) { this.RegisterArchive(archive, false); } }