Ejemplo n.º 1
0
 /// <summary>
 /// Print the name of one file as it is being packed into the cab.
 /// </summary>
 private static void PackProgress(object source, ArchiveProgressEventArgs e)
 {
     if (e.ProgressType == ArchiveProgressType.StartFile && log != null)
     {
         log.WriteLine("    {0}", e.CurrentFileName);
     }
 }
 private void UnpackArchiveProgress(object sender, ArchiveProgressEventArgs args)
 {
     if (UnpackArchiveProgression != null)
     {
         UnpackArchiveProgression((int)(args.FileBytesProcessed * 100 / args.TotalFileBytes));
     }
 }
Ejemplo n.º 3
0
 private static void ProgressHandler(object source, ArchiveProgressEventArgs e)
 {
     if (e.ProgressType == ArchiveProgressType.StartFile)
     {
         Console.WriteLine(e.CurrentFileName);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Method:             cabProgress
 /// Description:        This method lists the files that are currently being worked on during compression or decompression
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public static void cabProgress(object source, ArchiveProgressEventArgs e)
 {
     if (e.ProgressType == ArchiveProgressType.StartFile)
     {
         Console.WriteLine(e.CurrentFileName + " - file is being processed");
     }
 }
Ejemplo n.º 5
0
 private static void ProgressHandler(object sender, ArchiveProgressEventArgs eventArgs)
 {
     Console.WriteLine($"Name: {eventArgs.FileName}\n" +
                       $"AllProgress: {eventArgs.AllProgress}%\n" +
                       $"CurrentFileProgress: {eventArgs.CurrentFileProgress}%\n" +
                       $"Time: {eventArgs.ElapsedMilliseconds} ms");
 }
Ejemplo n.º 6
0
 protected void OnProgress(ArchiveProgressType progressType)
 {
     if (!suppressProgressEvents)
     {
         ArchiveProgressEventArgs e = new ArchiveProgressEventArgs(progressType, currentFileName, (currentFileNumber >= 0) ? currentFileNumber : 0, totalFiles, currentFileBytesProcessed, currentFileTotalBytes, currentArchiveName, currentArchiveNumber, totalArchives, currentArchiveBytesProcessed, currentArchiveTotalBytes, fileBytesProcessed, totalFileBytes);
         CabEngine.ReportProgress(e);
     }
 }
Ejemplo n.º 7
0
        private static void ProgHandler(object sender, ArchiveProgressEventArgs e)
        {
            //draw a small progress bar.
            Console.SetCursorPosition(0, Console.CursorTop);
            Console.Write("[          ] " + " Processing " + e.CurrentArchiveName + "... " + e.FileBytesProcessed + "/" + e.TotalFileBytes);

            //determine the progress:
            int progress = Convert.ToInt32(((e.FileBytesProcessed + 0.0) / e.TotalFileBytes) * 10);

            Console.SetCursorPosition(1, Console.CursorTop);

            for (int i = 0; i < progress; i++)
            {
                Console.Write("#");
            }
        }
Ejemplo n.º 8
0
        private void OnProgress(ArchiveProgressType progressType)
        {
            ArchiveProgressEventArgs e = new ArchiveProgressEventArgs(
                progressType,
                this.currentFileName,
                this.currentFileNumber >= 0 ? this.currentFileNumber : 0,
                this.totalFiles,
                this.currentFileBytesProcessed,
                this.currentFileTotalBytes,
                this.currentArchiveName,
                this.currentArchiveNumber,
                this.totalArchives,
                this.currentArchiveBytesProcessed,
                this.currentArchiveTotalBytes,
                this.fileBytesProcessed,
                this.totalFileBytes);

            this.OnProgress(e);
        }
Ejemplo n.º 9
0
        public void PrintArchiveProgress(object source, ArchiveProgressEventArgs e)
        {
            switch (e.ProgressType)
            {
            case ArchiveProgressType.StartFile:
            {
                Console.WriteLine("StartFile: {0}", e.CurrentFileName);
            } break;

            case ArchiveProgressType.FinishFile:
            {
                Console.WriteLine("FinishFile: {0}", e.CurrentFileName);
            } break;

            case ArchiveProgressType.StartArchive:
            {
                Console.WriteLine("StartArchive: {0} : {1}", e.CurrentArchiveNumber, e.CurrentArchiveName);
            } break;

            case ArchiveProgressType.FinishArchive:
            {
                Console.WriteLine("FinishArchive: {0} : {1}", e.CurrentArchiveNumber, e.CurrentArchiveName);
            } break;
            }

            File.AppendAllText(this.progressTextFile, e.ToString().Replace("\n", Environment.NewLine));

            if (CompressionTestUtil.expectedProgress != null &&
                e.ProgressType != ArchiveProgressType.PartialFile &&
                e.ProgressType != ArchiveProgressType.PartialArchive)
            {
                Assert.AreNotEqual <int>(0, CompressionTestUtil.expectedProgress.Count);
                int[] expected = CompressionTestUtil.expectedProgress[0];
                CompressionTestUtil.expectedProgress.RemoveAt(0);
                Assert.AreEqual <ArchiveProgressType>((ArchiveProgressType)expected[0], e.ProgressType, "Checking ProgressType.");
                Assert.AreEqual <int>(expected[1], e.CurrentFileNumber, "Checking CurrentFileNumber.");
                Assert.AreEqual <int>(expected[2], e.TotalFiles, "Checking TotalFiles.");
                Assert.AreEqual <int>(expected[4], e.CurrentArchiveNumber, "Checking CurrentArchiveNumber.");
                Assert.AreEqual <int>(expected[5], e.TotalArchives, "Checking TotalArchives.");
            }
        }
Ejemplo n.º 10
0
 protected void OnProgress(ArchiveProgressType progressType)
 {
     if (!this.suppressProgressEvents)
     {
         ArchiveProgressEventArgs e = new ArchiveProgressEventArgs(
             progressType,
             this.currentFileName,
             this.currentFileNumber >= 0 ? this.currentFileNumber : 0,
             this.totalFiles,
             this.currentFileBytesProcessed,
             this.currentFileTotalBytes,
             this.currentArchiveName,
             this.currentArchiveNumber,
             this.totalArchives,
             this.currentArchiveBytesProcessed,
             this.currentArchiveTotalBytes,
             this.fileBytesProcessed,
             this.totalFileBytes);
         this.CabEngine.ReportProgress(e);
     }
 }
Ejemplo n.º 11
0
 protected void OnProgress(ArchiveProgressType progressType)
 {
     if (!SuppressProgressEvents)
     {
         var e = new ArchiveProgressEventArgs(
             progressType,
             CurrentFileName,
             CurrentFileNumber >= 0 ? CurrentFileNumber : 0,
             TotalFiles,
             CurrentFileBytesProcessed,
             CurrentFileTotalBytes,
             CurrentArchiveName,
             CurrentArchiveNumber,
             TotalArchives,
             CurrentArchiveBytesProcessed,
             CurrentArchiveTotalBytes,
             FileBytesProcessed,
             TotalFileBytes);
         CabEngine.ReportProgress(e);
     }
 }
Ejemplo n.º 12
0
 internal void ReportProgress(ArchiveProgressEventArgs e)
 {
     base.OnProgress(e);
 }
Ejemplo n.º 13
0
 internal void ReportProgress(ArchiveProgressEventArgs e)
 {
     OnProgress(e);
 }
Ejemplo n.º 14
0
 protected void OnProgress(ArchiveProgressType progressType)
 {
     if (!this.suppressProgressEvents)
     {
         ArchiveProgressEventArgs e = new ArchiveProgressEventArgs(
             progressType,
             this.currentFileName,
             this.currentFileNumber >= 0 ? this.currentFileNumber : 0,
             this.totalFiles,
             this.currentFileBytesProcessed,
             this.currentFileTotalBytes,
             this.currentArchiveName,
             this.currentArchiveNumber,
             this.totalArchives,
             this.currentArchiveBytesProcessed,
             this.currentArchiveTotalBytes,
             this.fileBytesProcessed,
             this.totalFileBytes);
         this.CabEngine.ReportProgress(e);
     }
 }
Ejemplo n.º 15
0
 private void OnProgress(ArchiveProgressType progressType)
 {
     ArchiveProgressEventArgs e = new ArchiveProgressEventArgs(
         progressType,
         this.currentFileName,
         this.currentFileNumber >= 0 ? this.currentFileNumber : 0,
         this.totalFiles,
         this.currentFileBytesProcessed,
         this.currentFileTotalBytes,
         this.currentArchiveName,
         this.currentArchiveNumber,
         this.totalArchives,
         this.currentArchiveBytesProcessed,
         this.currentArchiveTotalBytes,
         this.fileBytesProcessed,
         this.totalFileBytes);
     this.OnProgress(e);
 }
Ejemplo n.º 16
0
 private void CabinetProgress(object sender, ArchiveProgressEventArgs e)
 {
     switch(e.ProgressType)
     {
     case ArchiveProgressType.StartFile:
     {
         string filePath = e.CurrentFileName;
         if(this.filePathMap != null)
         {
             InstallPath fileInstallPath = this.Files[e.CurrentFileName];
             if(fileInstallPath != null)
             {
                 filePath = fileInstallPath.SourcePath;
             }
         }
         this.LogMessage(this.cabMsg, this.cabName, e.CurrentFileName,
             Path.Combine(this.WorkingDirectory, filePath));
     }
     break;
     }
 }
Ejemplo n.º 17
0
 private static void Hanler(object sender, ArchiveProgressEventArgs e)
 {
     Console.WriteLine(e.CurrentFileName);
 }