started to write code for creating multiple progress bars
This commit is contained in:
parent
62b5f50041
commit
eccdfab567
1 changed files with 24 additions and 4 deletions
|
@ -12,17 +12,37 @@ namespace Saviour_Backup_System
|
||||||
{
|
{
|
||||||
public partial class currentTransfers : Form
|
public partial class currentTransfers : Form
|
||||||
{
|
{
|
||||||
|
public List<CopyFiles.CopyFiles> copyFilesList = new List<CopyFiles.CopyFiles>();
|
||||||
|
public List<transferWindow> transfersList = new List<transferWindow>();
|
||||||
|
public List<DevComponents.DotNetBar.Controls.ProgressBarX> progressBars = new List<DevComponents.DotNetBar.Controls.ProgressBarX>();
|
||||||
|
public int backups = -1; //used for index in arrays
|
||||||
|
|
||||||
public currentTransfers()
|
public currentTransfers()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
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();
|
transfersList.Add(new transferWindow());
|
||||||
copyDiag.
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue