| Line 73... |
Line 73... |
| 73 |
bwThread.WorkerSupportsCancellation = true;
|
73 |
bwThread.WorkerSupportsCancellation = true;
|
| 74 |
bwThread.DoWork += new DoWorkEventHandler(bwThread_DoWork);
|
74 |
bwThread.DoWork += new DoWorkEventHandler(bwThread_DoWork);
|
| 75 |
bwThread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwThread_RunWorkerCompleted);
|
75 |
bwThread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwThread_RunWorkerCompleted);
|
| 76 |
bwThread.RunWorkerAsync();
|
76 |
bwThread.RunWorkerAsync();
|
| 77 |
progressForm = new Reimage_USB_Drive_Progress_Form();
|
77 |
progressForm = new Reimage_USB_Drive_Progress_Form();
|
| 78 |
progressForm.Show();
|
78 |
progressForm.Show();
|
| - |
|
79 |
DebugText.appendText("Beginning the reimaging of USB Drives");
|
| 79 |
}
|
80 |
}
|
| 80 |
}
|
81 |
}
|
| 81 |
else
|
82 |
else
|
| 82 |
{
|
83 |
{
|
| 83 |
MessageBox.Show("bootsect.exe is missing from the master image location","Error");
|
84 |
MessageBox.Show("bootsect.exe is missing from the master image location","Error");
|
| Line 271... |
Line 272... |
| 271 |
}
|
272 |
}
|
| 272 |
else if (allThreadsCompleted)
|
273 |
else if (allThreadsCompleted)
|
| 273 |
{
|
274 |
{
|
| 274 |
threadsRunning = false;
|
275 |
threadsRunning = false;
|
| 275 |
endTime = DateTime.Now;
|
276 |
endTime = DateTime.Now;
|
| - |
|
277 |
DebugText.appendText("Reimaging of USB Drives started at " + startTime.ToShortTimeString() + " and ended at " + endTime.ToShortTimeString());
|
| 276 |
MessageBox.Show("Operation was started at " + startTime.ToShortTimeString() + " and ended successfully at " + endTime.ToShortTimeString());
|
278 |
MessageBox.Show("Operation was started at " + startTime.ToShortTimeString() + " and ended successfully at " + endTime.ToShortTimeString());
|
| 277 |
progressForm.closeForm();
|
279 |
progressForm.closeForm();
|
| 278 |
}
|
280 |
}
|
| 279 |
}
|
281 |
}
|
| 280 |
private static void bwThread_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
282 |
private static void bwThread_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
| 281 |
{
|
283 |
{
|
| 282 |
if (e.Cancelled)
|
284 |
if (e.Cancelled)
|
| 283 |
{
|
285 |
{
|
| 284 |
threadsRunning = false;
|
286 |
threadsRunning = false;
|
| - |
|
287 |
DebugText.appendText("USB reimaging operation has been cancelled");
|
| 285 |
MessageBox.Show("Operation was canceled");
|
288 |
MessageBox.Show("Operation was canceled");
|
| 286 |
progressForm.Close();
|
289 |
progressForm.Close();
|
| 287 |
}
|
290 |
}
|
| 288 |
}
|
291 |
}
|
| 289 |
private static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs, BackgroundWorker worker, DoWorkEventArgs e)
|
292 |
private static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs, BackgroundWorker worker, DoWorkEventArgs e)
|