예제 #1
0
 private void OnCompleteFile(string file)
 {
     CompletedFileHandler completedFile = CompletedFile;
     if (completedFile != null)
     {
         ScanEventArgs e = new ScanEventArgs(file);
         completedFile(this, e);
         alive_ = e.ContinueRunning;
     }
 }
예제 #2
0
 public bool OnProcessFile(string file)
 {
     bool continueRunning = true;
     ProcessFileHandler processFile = ProcessFile;
     if (processFile != null)
     {
         ScanEventArgs e = new ScanEventArgs(file);
         processFile(this, e);
         continueRunning = e.ContinueRunning;
     }
     return continueRunning;
 }
예제 #3
0
 public bool OnCompletedFile(string file)
 {
     bool continueRunning = true;
     CompletedFileHandler completedFile = CompletedFile;
     if (completedFile != null)
     {
         ScanEventArgs e = new ScanEventArgs(file);
         completedFile(this, e);
         continueRunning = e.ContinueRunning;
     }
     return continueRunning;
 }
예제 #4
0
 private void ProcessFile(object sender, ScanEventArgs e)
 {
     if ((_events != null) && (_events.ProcessFile != null))
     {
         _events.ProcessFile(sender, e);
     }
     if (e.ContinueRunning)
     {
         try
         {
             using (FileStream stream = File.Open(e.Name, FileMode.Open, FileAccess.Read, FileShare.Read))
             {
                 ZipEntry entry = _entryFactory.MakeFileEntry(e.Name);
                 _outputStream.PutNextEntry(entry);
                 AddFileContents(e.Name, stream);
             }
         }
         catch (Exception exception)
         {
             if (_events == null)
             {
                 _continueRunning = false;
                 throw;
             }
             _continueRunning = _events.OnFileFailure(e.Name, exception);
         }
     }
 }
예제 #5
0
 private void OnProcessFile(string file)
 {
     ProcessFileHandler processFile = ProcessFile;
     if (processFile != null)
     {
         ScanEventArgs e = new ScanEventArgs(file);
         processFile(this, e);
         alive_ = e.ContinueRunning;
     }
 }