public void EditAllAt(int index, SpamAction spamAction) { spamList[index] = spamAction; spamList[index].UpdateNumber(); // destroy previous thread here if (threadList[index].IsAlive) { threadList[index].Resume(); threadList[index].Abort(); } threadList[index] = new Thread(new ThreadStart(spamAction.SendMessage)); listBox.Items[index] = CreateListBoxString(spamAction); }
public string CreateListBoxString(SpamAction spamAction) { String[] strings = new string[] { spamAction.Time.ToString(), spamAction.NumberMessage, spamAction.Delay.ToString() }; string liststring = spamAction.SpamMessage; foreach (String s in strings) { liststring += ", "; if (s == "") { liststring += "none"; } else { liststring += s; } } return(liststring); }
public void AddToAll(SpamAction spamAction) { spamList.Add(spamAction); threadList.Add(new Thread(new ThreadStart(spamAction.SendMessage))); listBox.Items.Add(CreateListBoxString(spamAction)); }