Mercurial > silverbladetech
diff MetroWpf/Stocks.Service/StocksService.cs @ 21:dfc81f8bb838
working version for sttocks except ui within metrowpf
author | adminsh@apollo |
---|---|
date | Tue, 20 Mar 2012 15:07:31 +0000 |
parents | 6109bc268b90 |
children | 399398841fd0 |
line wrap: on
line diff
--- a/MetroWpf/Stocks.Service/StocksService.cs Tue Mar 20 13:37:46 2012 +0000 +++ b/MetroWpf/Stocks.Service/StocksService.cs Tue Mar 20 15:07:31 2012 +0000 @@ -49,7 +49,7 @@ public IList<Price> GetFullCurrentPrices() { - return _companies.Select(company => new Price(company.Symbol, 0, 0)).ToList(); + return _companies.Select(company => new Price(company.Name, company.Symbol, 0, 0)).ToList(); } public event PriceChangedEventHandler PriceChanged; @@ -115,11 +115,18 @@ foreach (var webPriceData in webPrices) { var webPrice = Factory.CreatePrice(webPriceData); - var localPrice = _currentPrices.Find(x => x.Symbol == webPrice.Symbol); + + var localPrice = _currentPrices.Find( + x => x.Symbol == webPrice.Symbol); if (localPrice == null) { - _currentPrices.Add(new Price(webPrice.Symbol, webPrice.CurrentPrice, webPrice.PreviousPrice)); + _currentPrices.Add( + new Price( + webPrice.CompanyName, + webPrice.Symbol, + webPrice.CurrentPrice, + webPrice.PreviousPrice)); continue; }