My problem is that I have this upload queue, and when I'm putting x number amount of files in the queue it only shows me the last file because the for loop goes around too fast.
for (i = 0; i < uploadFileList.Count; i++)
{
if (percentage == 100)
{
projects_tab.IsEnabled = true;
wait_for_upload_text.Visibility = Visibility.Hidden;
ModelUploadTXT.Text = "Upload done!";
FooterProgressBar.Value = 0;
FooterProgressBar.Foreground = Brushes.LimeGreen;
cancel_upload_model_button.Visibility = Visibility.Hidden;
SelectedFileText.Text = "Choose model(s) to import!";
try
{
uploadClient.Dispose();
}
catch (Exception asd)
{
}
}
else
{
choosedProjetName = uploadFileList[i];
ShowHome();
cancel_upload_model_button.Visibility = Visibility.Visible;
ModelUploadTXT.Text = "Uploading " + choosedProjetName + FooterProgressBar.Value.ToString("f0") + " % " + (bytesIn / 1000000).ToString("f2") + "Mb /" + (totalBytes / 1000000).ToString("f2") + "Mb";
FooterProgressBar.Foreground = Brushes.Orange;
}
}
I've tried to use
Task.Delay(1)
System.Theading.Thread.Sleep(1)
to work it around, but they haven't worked. So what I basically need is to wait percentage to go 100 and then go to next index.