ComponentPro UltimateZip

      SaveProgressEventArgs Class

      See AlsoMembersMembers Options: Show AllLanguage Filter: AllSend comments on this topic to ComponentPro
      Provides data for the SaveProgress event.

      Syntax

      public class SaveProgressEventArgs : AsyncEventArgs

      Examples

      Shows how to handle the SaveProgress event.

      using System;
      using ComponentPro.Compression;
      
      ...
      
      // Create a new instance.
      Zip zip = new Zip();
      // Create a new zip file.
      zip.Create("test.zip");
      
      // Add all files and subdirectories from 'c:\test' to the archive.
      zip.AddFiles(@"c:\test");            
      
      // Close the zip file.
      zip.Close();
      
      // Reopen the ZIP file to modify
      zip = new Zip();
      zip.Open("test.zip");
      
      zip.SaveProgress += zip_SaveProgress;
      zip.Delete("*.cs", true); // Delete some files. This would cause the archive to preserve some files within the archive.
      
      zip.Close();
      
              static void zip_SaveProgress(object sender, SaveProgressEventArgs e)
                 string msg = null;
      switch (e.State)
      {
          case SaveProgressState.BackupArchive:
              msg = "Backing up archive...";
              break;
      
          case SaveProgressState.PreserveFile:
              msg = "Preserving file " + e.FileName + "...";
              break;
      
          case SaveProgressState.Rollback:
              msg = "Rolling back...";
              break;
      
          case SaveProgressState.SaveArchive:
              msg = "Saving archive...";
              break;
      }
      
      Console.WriteLine(msg + " " + e.Percentage + "%");

      Inheritance Hierarchy

               ComponentPro.Compression.ComponentPro.Compression.SaveProgressEventArgs

      Framework

      .NET Compact Framework.NET Compact Framework

      Supported version: 2.0, 3.5, and 3.9
      Assembly: ComponentPro.Zip.CF (in ComponentPro.Zip.CF.dll)

      .NET Framework.NET Framework

      Supported version: 2.0, 3.0, 3.5, 4.0, 4.5.x, 4.6.x and later
      Assembly: ComponentPro.Zip (in ComponentPro.Zip.dll)

      Xamarin AndroidXamarin Android

      Supported version: 2.3 and later
      Assembly: ComponentPro.Zip.Android (in ComponentPro.Zip.Android.dll)

      Xamarin iOSXamarin iOS

      Supported version: 5.1.x and later
      Assembly: ComponentPro.Zip.iOS (in ComponentPro.Zip.iOS.dll)

      See Also