public void Initialize(Stock.StockTrade stockTrade, IStockInfoDbService stockInfoDbService) { if (stockTrade == null) throw new ArgumentNullException("stockTrade"); if (stockInfoDbService == null) throw new ArgumentNullException("stockInfoDbService"); this._stockTrade = stockTrade; this._stockInfoDbService = stockInfoDbService; // 確保不會判斷昨天的資料 if (LastGetStockInfoTime.Date != DateTime.Now.Date) { foreach (var id in stockTrade.GetAllStockId()) StockInfoDictionary[id] = null; } }