private 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 guarantees 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); // Set up AES encryption for the entry if required. ConfigureEntryEncryption(entry); 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 (var store = IsolatedStorageFile.GetUserStoreForApplication()) { using (var stream = store.OpenFile(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 ListFile(object sender, ScanEventArgs e) { Console.WriteLine("{0}", e.Name); }
void ProcessFile(object sender, ScanEventArgs e) { Console.WriteLine(e.Name); }
void OnCompletedFile(object sender, ScanEventArgs e) { ++mFileCompletedCount; }
private void Read() { while (serialPort.IsOpen) { try { string message = serialPort.ReadLine(); switch (message [0]) { case 'o': string[] parameters = message.Split(','); OdometryUpdateEventArgs args = new OdometryUpdateEventArgs( Int32.Parse(parameters [1]), Int32.Parse(parameters [2]), Double.Parse(parameters [3])); this.OnOdometryUpdate(args); break; case 's': string[] stringReadings = message.Split(','); List <double> readings = new List <double> (); // Somewhat inefficient. Start from 1 to skip first character // which is the message header. for (int i = 1; i < stringReadings.Length; i++) { readings.Add(Double.Parse(stringReadings [i])); } readings.Reverse(); ScanEventArgs args2 = new ScanEventArgs(readings); OnScanPerformed(args2); break; default: break; } } catch (TimeoutException ex) { Console.WriteLine(ex.ToString()); } catch (FormatException ex) { Console.WriteLine(ex.ToString()); } catch (IndexOutOfRangeException ex) { Console.WriteLine(ex.ToString()); } catch (ThreadAbortException) { // Ignore it. } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } }
private void ProcessFile(object sender, ScanEventArgs e) { Log.LogMessage(Properties.Resources.UnzipExtracted, e.Name); }
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"); }
public void Device_ScannerReader(object sender, ScanEventArgs e) { textBox1.Text = e.BarCode; }
/// <summary> /// Handles a scan, simply updates the landmark database and map if required /// by extracting them using the EKF algorithm. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> private void SerialProxy_Scan(object sender, ScanEventArgs e) { }
public void OnDeviceScanned(ScanEventArgs e) { if (DeviceScanned != null) DeviceScanned(this, e); }
private void OnScanFail(object sender, ScanEventArgs e) { }
private void ProcessFile(object sender, ScanEventArgs e) { _output.Output("Processing file: " + e.Name); }
public static void CompletedFileHandler(object sender, ScanEventArgs e) { }
/// <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); }
internal FastZipArchiveScanEventArgs(ScanEventArgs e) { _scanEventArgs = e; }