private void DataSearch_DownloadProgress(int epid, int percent, ProgressType type)
{
if (this.IsDisposed)
{
return;
}
if (this.InvokeRequired)
{
this.Invoke((MethodInvoker)(() => { this.DataSearch_DownloadProgress(epid, percent, type); }));
return;
}
ListViewItem item = this.ListDownloads.Items[Convert.ToString(epid, CultureInfo.InvariantCulture)];
if (item == null)
{
return;
}
if (this.downloadColOrder.Contains(Model.Download.DownloadCols.Status))
{
string statusText = "Downloading...";
if (type == ProgressType.Processing)
{
statusText = "Processing...";
}
item.SubItems[this.downloadColOrder.IndexOf(Model.Download.DownloadCols.Status)].Text = statusText;
}
if (this.downloadColOrder.Contains(Model.Download.DownloadCols.Progress))
{
this.ListDownloads.ShowProgress(item, this.downloadColOrder.IndexOf(Model.Download.DownloadCols.Progress), percent);
}
switch (type)
{
case ProgressType.Downloading:
item.ImageKey = "downloading";
break;
case ProgressType.Processing:
item.ImageKey = "processing";
break;
}
}