Ejemplo n.º 1
0
 public SrcMLArchiveEventsHandlers()
 {
     scheduler = new LimitedConcurrencyLevelTaskScheduler(2, this);
     factory   = new TaskFactory(scheduler);
     Instance  = this;
     hideProgressBarTimer.Elapsed += waitToUpdateProgressBar_Elapsed;
 }
 public void AddFilesToIndex(string filesInThisDirectory)
 {
     _handler = new SrcMLArchiveEventsHandlers(GetATestingScheduler());
     var files = GetFileList(filesInThisDirectory);
     foreach (var file in files)
     {
         if (IsSourceFile(file) || Path.GetExtension(Path.GetFullPath(file)).Equals(".txt"))
         {
             if (IsSourceFile(file) )
                 _srcMLArchive.AddOrUpdateFile(file);
             HandleFileUpdated(file);
         }
     }
     done = true;
 }
Ejemplo n.º 3
0
 public LimitedConcurrencyLevelTaskScheduler(int maxDegreeOfParallelism, SrcMLArchiveEventsHandlers handler)
     : this(maxDegreeOfParallelism)
 {
     _handler = handler;
 }
Ejemplo n.º 4
0
 private void RegisterSrcMLHandlers(SrcMLArchiveEventsHandlers srcMLArchiveEventsHandlers)
 {
     if (!_setupHandlers)
     {
         _setupHandlers = true;
         srcMLService.SourceFileChanged += srcMLArchiveEventsHandlers.SourceFileChanged;
         srcMLService.MonitoringStopped += srcMLArchiveEventsHandlers.MonitoringStopped;
     }
 }