Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
 }
Esempio n. 4
0
 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;
     }
 }
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
 /// <summary>ZipErrorイベント ハンドラ</summary>
 protected void ZipErrorEventHandler(Object sender, ZipErrorEventArgs e)
 {
     //Debug.WriteLine("ZipErrorEventHandler\r\n"
     //    + "sender:" + sender.ToString() + ", " + "e.ArchiveName:" + e.ArchiveName);
 }
Esempio n. 8
0
        // 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;
        }
Esempio n. 9
0
        /// <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;
        }
Esempio n. 11
0
 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();
 }
Esempio n. 13
0
 private void z_ZipError(object sender, ZipErrorEventArgs e)
 {
     picStatus.Image = igcmd.Properties.Resources.warning;
     lblStatus.Text = "Invalid theme!";
 }
Esempio n. 14
0
        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;
            }
        }
Esempio n. 15
0
 /// <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)
 {
 }