private void startTask(string threadID) { if (!Q.ContainsKey(threadID)) { return; } Spammer s = Q[threadID]; s.Go(); }
// -- some stuff goes here that keeps track of the task pool list and interacts with it. public void addTask(Spammer sp) { ListViewItem tmp = new ListViewItem() { Name = "JobTask_" + sp.taskID, Tag = (string)sp.taskID, Text = sp.taskID }; tmp.SubItems.Add("Idle"); listView1.Items.Add(tmp); sp.Go(); Q.Add(sp.taskID, sp); sp = null; }