From eccdfab56786404b336ee165933f857b4d81132e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 21 Nov 2014 22:30:32 +0000 Subject: [PATCH] started to write code for creating multiple progress bars --- Saviour Backup System/currentTransfers.cs | 28 +++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Saviour Backup System/currentTransfers.cs b/Saviour Backup System/currentTransfers.cs index 8ad41c6..3b58c68 100644 --- a/Saviour Backup System/currentTransfers.cs +++ b/Saviour Backup System/currentTransfers.cs @@ -12,17 +12,37 @@ namespace Saviour_Backup_System { public partial class currentTransfers : Form { + public List copyFilesList = new List(); + public List transfersList = new List(); + public List progressBars = new List(); + public int backups = -1; //used for index in arrays + public currentTransfers() { InitializeComponent(); } - private void copyFiles(string startDirectory, string endDirectory) + private void copyFiles(string driveLetter, string endDirectory, bool display) //actually starts the backups (and loads the dialogs) { - CopyFiles.CopyFiles Temp = new CopyFiles.CopyFiles(startDirectory, endDirectory); + backups++; //appends to the number of backups running + copyFilesList.Add(new CopyFiles.CopyFiles(driveLetter + ":\\", endDirectory)); - transferWindow copyDiag = new transferWindow(); - copyDiag. + transfersList.Add(new transferWindow()); + transfersList[backups].SynchronizationObject = this; + copyFilesList[backups].CopyAsync(transfersList[backups]); + if (!display) { transfersList[backups].Hide(); } } + + private void currentTransfers_Load(object sender, EventArgs e) + { + foreach (DevComponents.DotNetBar.Controls.ProgressBarX PB in progressBars) { PB.Dispose(); } + for (int i = 0; i < backups; i++) + { + progressBars.Add(new DevComponents.DotNetBar.Controls.ProgressBarX()); + progressBars[i] = progressTemplate; + progressBars[i].Location = new Point(12, (30 * i) + 59); + } + } + } }