Now I need to be able to retrieve the enum values from exchValand set the appropriate checkBoxes. Here's what I tried but it's not working assuming the checkBoxes are now set to false:
public class Stock : INotifyPropertyChanged { private string symbol; private double price; private int size; public event PropertyChangedEventHandler PropertyChanged; public Stock(string symbol, double price, int size) { this.symbol = symbol; this.price = price; this.size = size; } public string Symbol { get { return symbol; } } public double Price { get { return price; } set { if (price != value) { price = value; OnPropertyChanged("Price"); } } } public int Size { get { return size; } set { if (size != value) { size = value; OnPropertyChanged("Size"); } } } private void OnPropertyChanged(string propertyName) { if(PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public class StocksManager { // Members int NUM_PROCESSORS = Environment.ProcessorCount; MktDataSim mktData; List<Thread> workers; EventWaitHandle signal; Queue<stock> workQueue; object sync; Dictionary<string, stock=""> stocksCollec; List<stock> tempStocksCollec; // Constructor public StocksManager() { mktData = new MktDataSim(); workers = new List<Thread>(); signal = new AutoResetEvent(false); workQueue = new Queue<stock>(); sync = new object(); stocksCollec = new Dictionary<string, stock="">(); tempStocksCollec = new List<stock>(); mktData.StockUpdateHandler += new StockUpdateEventHandler (mktData_StockUpdateHandler); for (int i = 0; i < NUM_PROCESSORS; i++) { workers.Add(new Thread(worker)); workers[i].IsBackground = true; workers[i].Start(); } } // Properties public List<stock> StockCollection { get { return tempStocksCollec; } } // Methods/Event Handlers private void mktData_StockUpdateHandler(string symbol, double price, int size) { getMktData(new Stock(symbol, price, size)); } private void getMktData(Stock stock) { lock (sync) workQueue.Enqueue(stock); signal.Set(); } private void worker() { while (true) { Stock stock = null; lock (sync) { if (workQueue.Count > 0) stock = workQueue.Dequeue(); } if (stock != null) { string sym = stock.Symbol; double prc = stock.Price; int sz = stock.Size; tempStocksCollec.Clear(); if (!stocksCollec.ContainsKey(sym)) { stocksCollec.Add(sym, new Stock(sym, prc, sz)); } else { stocksCollec[sym].Price = prc; stocksCollec[sym].Size = sz; } tempStocksCollec.AddRange(stocksCol