public bool addTag(Tag tag) { if (tags.ContainsKey(tag.id)) { return(false); } lock (tags) { tags.Add(tag.id, tag); } //Thread thread = new Thread(new ParameterizedThreadStart(TagProcessing.Read)); Thread thread = new Thread(() => TagProcessing.Read(tag)); lock (threads) { threads.Add(tag.id, thread); thread.Start(); } XMLConfig.WriteData(); return(true); }
public bool changeScan(string id) { if (!tags.ContainsKey(id)) { return(false); } lock (tags) { tags[id].on = !tags[id].on; } XMLConfig.WriteData(); return(true); }
public bool removeTag(string id) { if (!tags.ContainsKey(id)) { return(false); } lock (tags) { tags.Remove(id); } lock (threads) { threads[id].Abort(); threads.Remove(id); } XMLConfig.WriteData(); return(true); }