public void Schedule(IExecuteScheduler scheduler) { if (_subscriber != null) { throw new InvalidOperationException(nameof(Target.Schedule)); } _subscriber = scheduler.Schedule(ProcessTarget, OccurEvery); }
public void Load(IExecuteScheduler scheduler) { foreach (var targetPath in Directory.GetFiles(ProgramConsts.TargetsDir)) { try { var target = LoadTarget(targetPath); target.Schedule(scheduler); _nameToTarget.Add(target.Name, target); } catch { } } }
public Targets(IExecuteScheduler scheduler) { Load(scheduler); }