internal static ZipErrorEventArgs Saving(string archiveName, ZipEntry entry, Exception exception) { ZipErrorEventArgs zipErrorEventArgs = new ZipErrorEventArgs(); zipErrorEventArgs.EventType = ZipProgressEventType.Error_Saving; zipErrorEventArgs.ArchiveName = archiveName; zipErrorEventArgs.CurrentEntry = entry; zipErrorEventArgs._exc = exception; return(zipErrorEventArgs); }
internal static ZipErrorEventArgs Saving(string archiveName, ZipEntry entry, Exception exception) { var x = new ZipErrorEventArgs { EventType = ZipProgressEventType.Error_Saving, ArchiveName = archiveName, CurrentEntry = entry, _exc = exception }; return(x); }
internal bool OnZipErrorSaving(ZipEntry entry, Exception exc) { if (ZipError != null) { lock (LOCK) { var e = ZipErrorEventArgs.Saving(ArchiveNameForEvent, entry, exc); ZipError(this, e); if (e.Cancel) { _saveOperationCanceled = true; } } } return(_saveOperationCanceled); }
void ErrorHandler_RetryAndEventuallyThrow(object sender, ZipErrorEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Error_Saving: _retryCount++; if (_retryCount < 29) e.CurrentEntry.ZipErrorAction = ZipErrorAction.Retry; else e.CurrentEntry.ZipErrorAction = ZipErrorAction.Throw; break; } }
internal static ZipErrorEventArgs Saving(string archiveName, ZipEntry entry, Exception exception) { var x = new ZipErrorEventArgs { EventType = ZipProgressEventType.Error_Saving, ArchiveName = archiveName, CurrentEntry = entry, _exc = exception }; return x; }
static void oZip_ZipError(object sender, ZipErrorEventArgs e) { FiddlerApplication.Log.LogFormat("WriteSessionArchive skipped writing {0} to {1} because {2};\n{3}...", e.CurrentEntry.FileName, e.ArchiveName, e.Exception.Message, e.Exception.StackTrace); e.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; }
/// <summary>ZipErrorイベント ハンドラ</summary> protected void ZipErrorEventHandler(Object sender, ZipErrorEventArgs e) { //Debug.WriteLine("ZipErrorEventHandler\r\n" // + "sender:" + sender.ToString() + ", " + "e.ArchiveName:" + e.ArchiveName); }
// Ask the user what he wants to do public static void ZipError(object sender, ZipErrorEventArgs e) { Console.WriteLine("Error reading {0}...", e.FileName); Console.WriteLine(" Exception: {0}...", e.Exception); ZipEntry entry = e.CurrentEntry; string response = null; do { Console.Write("Retry, Skip, or Quit ? (R/S/Q) "); response = Console.ReadLine(); Console.WriteLine(); } while (response != null && response[0]!='S' && response[0]!='s' && response[0]!='R' && response[0]!='r' && response[0]!='Q' && response[0]!='q'); e.Cancel = (response[0]=='Q' || response[0]=='q'); if (response[0]=='S' || response[0]=='s') entry.ZipErrorAction = ZipErrorAction.Skip; else if (response[0]=='R' || response[0]=='r') entry.ZipErrorAction = ZipErrorAction.Retry; }
/// <summary> /// Called when an error occurs during Save() (Whitch executes WriteItemCallback) /// </summary> /// <param name="e"></param> private void ItemFailed(ZipErrorEventArgs e) { failedItems++; e.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; //Prevent the item from crashing the job. BatchResizeItem i = items[e.CurrentEntry.FileName]; Exception ex = e.Exception; //Fire off the event again.. ItemEventArgs args = new ItemEventArgs(s.jobId, new ItemResult(i,false, ex), GetJobStats()); s.FireItemEvent(args); //Store for later results.Add(args.Result); //If an event handler wants to cancel the job, do so. if (args.Cancel) e.Cancel = true; }
private void BackupFileOnZipError(object sender, ZipErrorEventArgs zipErrorEventArgs) { _log.Error( "An error occurred while compressing " + zipErrorEventArgs.FileName + " - file will be skipped.", zipErrorEventArgs.Exception); zipErrorEventArgs.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; }
protected void z_ZipError(object sender, ZipErrorEventArgs e) { //We can only deal with item errors here. We ignore job errors, they will throw an execption that bubbles up through Save() if (e.CurrentEntry != null) ItemFailed(e); }
void mjar_ZipError(object sender, ZipErrorEventArgs e) { //throw new NotImplementedException(); }
private void z_ZipError(object sender, ZipErrorEventArgs e) { picStatus.Image = igcmd.Properties.Resources.warning; lblStatus.Text = "Invalid theme!"; }
void z_ZipError(object sender, ZipErrorEventArgs e) { Console.WriteLine("Error adding file " + e.FileName); Console.WriteLine(e.Exception.Message); Console.WriteLine("(s)kip, (r)etry, or (c)ancel?"); var key = Console.ReadKey(); if (key.Key == ConsoleKey.S) e.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; else if (key.Key == ConsoleKey.R) e.CurrentEntry.ZipErrorAction = ZipErrorAction.Retry; else if (key.Key == ConsoleKey.C) { e.CurrentEntry.ZipErrorAction = ZipErrorAction.Throw; } }
/// <summary> /// Evento: Error al extraer un ZIP. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void zip_ZipError(object sender, ZipErrorEventArgs e) { }