From 04d5618e62a8651a09e976ecccb05f8a8227fca9 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 20 Nov 2014 15:57:31 +0000 Subject: [PATCH] Copied code from laptop for copying --- Saviour Backup System/transferWindow.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Saviour Backup System/transferWindow.cs b/Saviour Backup System/transferWindow.cs index 83f3289..b59b743 100644 --- a/Saviour Backup System/transferWindow.cs +++ b/Saviour Backup System/transferWindow.cs @@ -10,11 +10,27 @@ using System.Windows.Forms; namespace Saviour_Backup_System { - public partial class transferWindow : Form + public partial class transferWindow : Form, CopyFiles.ICopyFilesDiag { + public System.ComponentModel.ISynchronizeInvoke SyncronizationObject { get; set; } + public transferWindow() { InitializeComponent(); } + public void update(Int32 totalFiles, Int32 copiedFiles, Int64 totalBytes, Int64 copiedBytes, string currentFilename) + { + totalFilesProgress.Maximum = totalFiles; + totalFilesProgress.Value = copiedFiles; + currentFileProgress.Maximum = 100; //so its a percentage, might make it more accurate. + + if (totalBytes != 0) { + currentFileProgress.Value = Convert.ToInt32((100f / (totalBytes / 1024f)) * (copiedBytes / 1024f)); + } + totalFilesProgress.Text = "Copying File " + copiedFiles + " of " + totalFiles + "."; + currentFile.Text = currentFilename; + } + + public event CopyFiles.CopyFiles.DEL_cancelCopy EN_cancelCopy; } }