示例#1
0
 public void Schedule(IExecuteScheduler scheduler)
 {
     if (_subscriber != null)
     {
         throw new InvalidOperationException(nameof(Target.Schedule));
     }
     _subscriber = scheduler.Schedule(ProcessTarget, OccurEvery);
 }
示例#2
0
 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
         {
         }
     }
 }
示例#3
0
 public Targets(IExecuteScheduler scheduler)
 {
     Load(scheduler);
 }