private void OnCompleteFile(string file) { CompletedFileHandler completedFile = this.CompletedFile; if (completedFile != null) { ScanEventArgs e = new ScanEventArgs(file); completedFile(this, e); this.alive_ = e.ContinueRunning; } }
public bool OnCompletedFile(string file) { bool continueRunning = true; CompletedFileHandler completedFile = this.CompletedFile; if (completedFile != null) { ScanEventArgs e = new ScanEventArgs(file); completedFile(this, e); continueRunning = e.ContinueRunning; } return continueRunning; }
public bool OnProcessFile(string file) { bool continueRunning = true; ProcessFileHandler processFile = this.ProcessFile; if (processFile != null) { ScanEventArgs e = new ScanEventArgs(file); processFile(this, e); continueRunning = e.ContinueRunning; } return continueRunning; }
/// <summary> /// Raises the ProcessFileEvent. /// </summary> /// <param name="file">The file for this event.</param> public void OnProcessFile(string file) { if ( ProcessFile != null ) { ScanEventArgs args = new ScanEventArgs(file); ProcessFile(this, args); } }
void ProcessFile(object sender, ScanEventArgs e) { if ( (events_ != null) && (events_.ProcessFile != null) ) { events_.ProcessFile(sender, e); } if ( e.ContinueRunning ) { ZipEntry entry = entryFactory_.MakeFileEntry(e.Name); outputStream_.PutNextEntry(entry); AddFileContents(e.Name); } }
void ProcessFile(object sender, ScanEventArgs e) { Console.WriteLine(e.Name); }
/// <summary> /// Fires the <see cref="CompletedFile"/> delegate /// </summary> /// <param name="file">The file whose processing has been completed.</param> /// <returns>A boolean indicating if execution should continue or not.</returns> public bool OnCompletedFile(string file) { bool result = true; CompletedFileHandler handler = CompletedFile; if ( handler != null ) { ScanEventArgs args = new ScanEventArgs(file); handler(this, args); result = args.ContinueRunning; } return result; }
/// <summary> /// Raise the complete file event /// </summary> /// <param name="file">The file name</param> void OnCompleteFile(string file) { CompletedFileHandler handler = CompletedFile; if (handler != null) { ScanEventArgs args = new ScanEventArgs(file); handler(this, args); alive_ = args.ContinueRunning; } }
/// <summary> /// Raise the ProcessFile event. /// </summary> /// <param name="file">The file name.</param> public void OnProcessFile(string file) { if ( ProcessFile != null ) { ScanEventArgs args = new ScanEventArgs(file); ProcessFile(this, args); alive_ = args.ContinueRunning; } }
private void OnProcessFile(string file) { ProcessFileHandler processFile = this.ProcessFile; if (processFile != null) { ScanEventArgs e = new ScanEventArgs(file); processFile(this, e); this.alive_ = e.ContinueRunning; } }
private void ProcessFileMethod(object sender, ScanEventArgs args) { _uptoFileCount++; int percentCompleted = _uptoFileCount * 100 / _totalFileCount; // do something here with a progress bar // file counts are easier as sizes take more work to calculate, and compression levels vary by file type string fileName = args.Name; // To terminate the process, set args.ContinueRunning = false if (fileName == "stop on this file") args.ContinueRunning = false; }
private void ProcessFile(object sender, ScanEventArgs e) { _output.Output("Processing file: " + e.Name); }
private void ProcessFile(object sender, ScanEventArgs e) { if ((this.events_ != null) && (this.events_.ProcessFile != null)) { this.events_.ProcessFile(sender, e); } if (e.ContinueRunning) { try { using (FileStream stream = File.Open(e.Name, FileMode.Open, FileAccess.Read, FileShare.Read)) { ZipEntry entry = this.entryFactory_.MakeFileEntry(e.Name); this.outputStream_.PutNextEntry(entry); this.AddFileContents(e.Name, stream); } } catch (Exception exception) { if (this.events_ == null) { this.continueRunning_ = false; throw; } this.continueRunning_ = this.events_.OnFileFailure(e.Name, exception); } } }
/// <summary> /// Callback for adding a new file. /// </summary> /// <param name="sender">The scanner calling this delegate.</param> /// <param name="args">The event arguments.</param> void ProcessFile(object sender, ScanEventArgs args) { if ( !silent_ ) { Console.WriteLine(args.Name); } activeZipFile_.Add(args.Name); }
/// <summary> /// Callback for adding a new file. /// </summary> /// <param name="sender">The scanner calling this delegate.</param> /// <param name="args">The event arguments.</param> void ProcessFile(object sender, ScanEventArgs args) { activeZipFile_.Add(args.Name); }
/// <summary> /// Fires the <see cref="ProcessFile">ProcessFile delegate</see>. /// </summary> /// <param name="file">The file being processed.</param> /// <returns>A boolean indicating if execution should continue or not.</returns> public bool OnProcessFile(string file) { bool result = true; ProcessFileHandler handler = ProcessFile; if (handler != null) { var args = new ScanEventArgs(file); handler(this, args); result = args.ContinueRunning; } return result; }
/// <summary> /// Raise the complete file event /// </summary> /// <param name="file">The file name</param> void OnCompleteFile(string file) { if (CompletedFile != null) { ScanEventArgs args = new ScanEventArgs(file); CompletedFile(this, args); alive_ = args.ContinueRunning; } }
private void ProcessFile(object sender, ScanEventArgs e) { if (e.ContinueRunning) { using (FileStream stream = File.OpenRead(e.Name)) { ZipEntry entry = entryFactory_.MakeFileEntry(e.Name); outputStream_.PutNextEntry(entry); AddFileContents(stream); } } }
private void ProcessFile(object sender, ScanEventArgs e) { Log.LogMessage(Properties.Resources.UnzipExtracted, e.Name); }
/// <summary> /// Raise the ProcessFile event. /// </summary> /// <param name="file">The file name.</param> void OnProcessFile(string file) { ProcessFileHandler handler = ProcessFile; if ( handler!= null ) { ScanEventArgs args = new ScanEventArgs(file); handler(this, args); alive_ = args.ContinueRunning; } }
void ProcessFile(object sender, ScanEventArgs e) { //if ( (events_ != null) && (events_.ProcessFile != null) ) { // events_.ProcessFile(sender, e); //} //if ( e.ContinueRunning ) { // try { // // The open below is equivalent to OpenRead which gaurantees that if opened the // // file will not be changed by subsequent openers, but precludes opening in some cases // // were it could succeed. ie the open may fail as its already open for writing and the share mode should reflect that. // 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 ex) { // if (events_ != null) { // continueRunning_ = events_.OnFileFailure(e.Name, ex); // } // else { // continueRunning_ = false; // throw; // } // } //} }
void ProcessFile(object sender, ScanEventArgs e) { if ( (events_ != null) && (events_.ProcessFile != null) ) { events_.ProcessFile(sender, e); } if ( e.ContinueRunning ) { try { // The open below is equivalent to OpenRead which gaurantees that if opened the // file will not be changed by subsequent openers, but precludes opening in some cases // were it could succeed. 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 ex) { if (events_ != null) { continueRunning_ = events_.OnFileFailure(e.Name, ex); } else { continueRunning_ = false; throw; } } } }
public void ProcessFile(Object sender, ScanEventArgs e) { label2.SafeInvoke(d => d.Text = e.Name); changeprogressbar(progressBar2, 1); textBox4.SafeInvoke(d => d.Text = Convert.ToInt32(((Convert.ToDecimal(progressBar2.Value) / Convert.ToDecimal(progressBar2.Maximum)) * 100)).ToString() + "% concluído"); }
void ListFile(object sender, ScanEventArgs e) { Console.WriteLine("{0}", e.Name); }
void ProcessFile(object sender, ScanEventArgs e) { if ( events != null ) { events.OnProcessFile(e.Name); } string cleanedName = nameTransform.TransformFile(e.Name); ZipEntry entry = new ZipEntry(cleanedName); outputStream.PutNextEntry(entry); AddFileContents(e.Name); }
/// <summary> /// Fires the <see cref="ProcessFile">Process File delegate</see>. /// </summary> /// <param name="file">The file being processed.</param> /// <returns>A boolean indicating if execution should continue or not.</returns> public bool OnProcessFile(string file) { bool result = true; if ( ProcessFile != null ) { ScanEventArgs args = new ScanEventArgs(file); ProcessFile(this, args); result = args.ContinueRunning; } return result; }
private void ProcessFileMethod(object sender, ScanEventArgs args) { string fileName = args.Name; // To stop all further processing, set args.ContinueRunning = false if (_stop) { args.ContinueRunning = false; } }