public ItemUpdater(bool multiThreaded, bool useArmory, bool usePTR, int itemsPerSecond, WowheadService.UpgradeCancelCheck check) { this.itemsDone = 0; this.itemsToDo = 0; this.finishedInput = false; this.done = false; this.newItems = new Dictionary<int, Item>(); // was a SortedDictionary this.multiThreaded = multiThreaded; this.cancel = check; this.useArmory = useArmory; this.usePTR = usePTR; this.eventDone = new AutoResetEvent(false); this.lockObject = new Object(); this.itemsPerSecond = itemsPerSecond; this.itemQueue = new Queue<ItemToUpdate>(); if (multiThreaded) { // Thread t = new Thread(new ThreadStart(Throttle)); ThreadPool.QueueUserWorkItem(Throttle); // t.Start(); } }
public ItemUpdater(bool multiThreaded, bool useArmory, bool usePTR, int itemsPerSecond, WowheadService.UpgradeCancelCheck check) { this.itemsDone = 0; this.itemsToDo = 0; this.finishedInput = false; this.done = false; this.newItems = new Dictionary <int, Item>(); // was a SortedDictionary this.multiThreaded = multiThreaded; this.cancel = check; this.useArmory = useArmory; this.usePTR = usePTR; this.eventDone = new AutoResetEvent(false); this.lockObject = new Object(); this.itemsPerSecond = itemsPerSecond; this.itemQueue = new Queue <ItemToUpdate>(); if (multiThreaded) { // Thread t = new Thread(new ThreadStart(Throttle)); ThreadPool.QueueUserWorkItem(Throttle); // t.Start(); } }