1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
saviour-backup-system/Saviour Backup System/transferWindow.cs

47 lines
1.4 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
2014-11-21 22:34:43 +00:00
using CopyFiles;
namespace Saviour_Backup_System
{
2014-11-20 15:57:31 +00:00
public partial class transferWindow : Form, CopyFiles.ICopyFilesDiag
{
2014-11-21 22:34:43 +00:00
public System.ComponentModel.ISynchronizeInvoke SynchronizationObject { get; set; }
public transferWindow()
{
InitializeComponent();
}
2014-11-20 15:57:31 +00:00
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;
}
2014-11-21 22:34:43 +00:00
public void cancelCopy() {
if (EN_cancelCopy != null) { EN_cancelCopy(); }
}
2014-11-20 15:57:31 +00:00
public event CopyFiles.CopyFiles.DEL_cancelCopy EN_cancelCopy;
2014-11-21 22:34:43 +00:00
private void button1_Click(object sender, EventArgs e)
{
cancelCopy();
}
}
}