private void PriceSource_OnPricesUpdated(CurrencyPriceSource aPriceSource) { var lBTCPrice = aPriceSource.GetPrice(1, FiatCurrencies.USD); var lLTCPrice = aPriceSource.GetPrice(2, FiatCurrencies.CLP); FCompleted = lBTCPrice > 0 && lLTCPrice > 0; }
public void TestPriceSource() { var lPriceSource = CurrencyPriceSource.GetInstance(); lPriceSource.OnPricesUpdated += PriceSource_OnPricesUpdated; var lTestCurrencies = new List <ICurrencyItem> { new CurrencyItem() { Id = 1, Name = "Bitcoin", Ticker = "BTC" }, new CurrencyItem() { Id = 2, Name = "Litecoin", Ticker = "LTC" } }; lPriceSource.AddCurrenciesToWatch(lTestCurrencies); while (!FCompleted) { System.Threading.Thread.Sleep(1000); } }