public void RemoveDownloadTask(PluginCtrl uiCtrl) { lock (DownloadTask) { if (processingCtrl == uiCtrl) { if (client != null) { client.CancelAsync(); client.Dispose(); client = null; } } if (DownloadTask.Contains(uiCtrl)) { DownloadTask.Remove(uiCtrl); } } }