// 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;
            }
        }
        //Est déclenché en cas d'erreur lors de l'appel de la méthode Save()
        private void PSIonicZipErrorHandler(object sender, ZipErrorEventArgs e)
        {
            ZipEntry entry    = e.CurrentEntry;
            int      response = 0;

            Collection <ChoiceDescription> choices = new Collection <ChoiceDescription>();

            choices.Add(new ChoiceDescription("&Retry", "Retry the operation"));
            choices.Add(new ChoiceDescription("&Skip", "Retry the operation"));
            choices.Add(new ChoiceDescription("&Throw", "Abort with an exception"));
            choices.Add(new ChoiceDescription("&Cancel", "Cancel the operation"));
            response = ExecutionContext.Host.UI.PromptForChoice(
                string.Format("Error saving '{0}' : {1} ", e.FileName, e.Exception.Message),
                string.Format("Select an action for this entry '{0}'", e.CurrentEntry.FileName),
                choices,
                1);

            switch (response)
            {
            case 0: entry.ZipErrorAction = ZipErrorAction.Retry; break;

            case 1: entry.ZipErrorAction = ZipErrorAction.Skip; break;

            case 2: entry.ZipErrorAction = ZipErrorAction.Throw; break;

            case 3: e.Cancel = true; break;
            }
        }
Beispiel #3
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 exception that bubbles up through Save()
     if (e.CurrentEntry != null)
     {
         ItemFailed(e);
     }
 }
Beispiel #4
0
        void zip_Error(object sender, ZipErrorEventArgs e)
        {
            string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"TheLongDrive\Mods");

            downloadbar.Value = 80;

            downloadperc.Text = "Unzipping Failed!";
        }
Beispiel #5
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;
        }
Beispiel #6
0
        void OnZipError(object sender, ZipErrorEventArgs e)
        {
            try
            {
                switch (MessageBox.Show("Error extracting '" + e.FileName + "': " + e.Exception, "Error", MessageBoxButtons.AbortRetryIgnore))
                {
                case DialogResult.Abort: e.Cancel = true; ZipError = new CancelException(); return;

                case DialogResult.Retry: e.CurrentEntry.ZipErrorAction = ZipErrorAction.Retry; return;

                case DialogResult.Ignore: e.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; return;

                default: throw new NotSupportedException();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + "\nError while handling zip error for file " + e.FileName, ex);
            }
        }
Beispiel #7
0
 private void Package_ZipError(object sender, ZipErrorEventArgs e)
 {
     Thread.Sleep(10);
     Directory.Delete(tempDir, true);
     ChangeStatus("Packing package... Failed!");
     //ChangePercentage("100%");
     switch (MessageBox.Show("Error while packing! Packing canceled! Message: " + e.Exception.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error))
     {
     case DialogResult.OK:
         if (InvokeRequired)
         {
             Invoke(new Action(() => { this.Close(); }));
         }
         else
         {
             this.Close();
         }
         break;
     }
 }
Beispiel #8
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;
            }
        }
Beispiel #9
0
        /// <summary>
        /// Called when an error occurs during Save() (which 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;
            }
        }
Beispiel #10
0
        void OnZipError(object sender, ZipErrorEventArgs e)
        {
            try
            {
                ZippyForm.LogWriteLine(LogLevel.Information, "Error while extracting '" + e.FileName + "': " + e.Exception.Message);
                ZippyForm.LogWriteLine(LogLevel.LightDebug, "Detailed error: " + e.Exception.ToString());

                switch (MessageBox.Show("Error extracting '" + e.FileName + "': " + e.Exception, "Error", MessageBoxButtons.AbortRetryIgnore))
                {
                case DialogResult.Abort: e.Cancel = true; ZipError = new CancelException(); return;

                case DialogResult.Retry: e.CurrentEntry.ZipErrorAction = ZipErrorAction.Retry; return;

                case DialogResult.Ignore: e.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; return;

                default: throw new NotSupportedException();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + "\nError while handling zip error for file " + e.FileName, ex);
            }
        }
Beispiel #11
0
 void f_ZipError(object sender, ZipErrorEventArgs e)
 {
     throw new NotImplementedException();
 }
Beispiel #12
0
 private static void ArchiveZ_ZipError(object sender, ZipErrorEventArgs e)
 {
     Debug.WriteLine(e.Exception.Message);
 }
Beispiel #13
0
 private static void z_ZipError(object sender, ZipErrorEventArgs e)
 {
     _extractThemeResult = ThemeInstallingResult.ERROR;
 }
Beispiel #14
0
 /// <summary>ZipErrorイベント ハンドラ</summary>
 protected void ZipErrorEventHandler(Object sender, ZipErrorEventArgs e)
 {
     //Debug.WriteLine("ZipErrorEventHandler\r\n"
     //    + "sender:" + sender.ToString() + ", " + "e.ArchiveName:" + e.ArchiveName);
 }
Beispiel #15
0
 private void z_ZipError(object sender, ZipErrorEventArgs e)
 {
     picStatus.Image = igcmd.Properties.Resources.warning;
     lblStatus.Text  = "Theme was error!";
 }
Beispiel #16
0
 private void Zip_Error(object sender, ZipErrorEventArgs e)
 {
     MessageBox.Show(e.Exception.Message, "ZipMagikLITE: Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     this.Close();
 }