using System;
namespace PSMinIO.Utils
{
///
/// Event arguments for zip progress updates
///
public class ZipProgressEventArgs : EventArgs
{
///
/// Name of the current file being processed
///
public string CurrentFileName { get; set; } = string.Empty;
///
/// Progress percentage for the current file (0-100)
///
public double CurrentFileProgress { get; set; }
///
/// Bytes processed for the current file
///
public long CurrentFileBytesProcessed { get; set; }
///
/// Total size of the current file
///
public long CurrentFileSize { get; set; }
///
/// Number of files processed so far
///
public int TotalFilesProcessed { get; set; }
///
/// Total bytes processed across all files
///
public long TotalBytesProcessed { get; set; }
///
/// Elapsed time since compression started
///
public TimeSpan ElapsedTime { get; set; }
///
/// Current compression speed in bytes per second
///
public double CurrentSpeed => ElapsedTime.TotalSeconds > 0 ? TotalBytesProcessed / ElapsedTime.TotalSeconds : 0;
}
///
/// Event arguments for when a file is added to the zip
///
public class ZipFileEventArgs : EventArgs
{
///
/// Original file name
///
public string FileName { get; set; } = string.Empty;
///
/// Entry name in the zip archive
///
public string EntryName { get; set; } = string.Empty;
///
/// Uncompressed size of the file
///
public long UncompressedSize { get; set; }
///
/// Compressed size in the zip archive
///
public long CompressedSize { get; set; }
///
/// Compression ratio (compressed/uncompressed)
///
public double CompressionRatio { get; set; }
///
/// Time taken to process this file
///
public TimeSpan ProcessingTime { get; set; }
///
/// Compression efficiency percentage (100 - ratio * 100)
///
public double CompressionEfficiency => (1 - CompressionRatio) * 100;
}
///
/// Event arguments for when zip compression is completed
///
public class ZipCompletedEventArgs : EventArgs
{
///
/// Time when compression started
///
public DateTime StartTime { get; set; }
///
/// Time when compression completed
///
public DateTime EndTime { get; set; }
///
/// Total duration of compression
///
public TimeSpan Duration { get; set; }
///
/// Total number of files compressed
///
public int TotalFiles { get; set; }
///
/// Total uncompressed size of all files
///
public long TotalUncompressedSize { get; set; }
///
/// Total compressed size of the zip archive
///
public long TotalCompressedSize { get; set; }
///
/// Overall compression ratio
///
public double CompressionRatio { get; set; }
///
/// Average compression speed in bytes per second
///
public double AverageCompressionSpeed { get; set; }
///
/// Overall compression efficiency percentage
///
public double CompressionEfficiency => (1 - CompressionRatio) * 100;
///
/// Space saved by compression
///
public long SpaceSaved => TotalUncompressedSize - TotalCompressedSize;
}
}