/// <summary> /// Retrieves information about a stock /// </summary> /// <param name="symbol">The symbol to retrieve the info for</param> /// <param name="callback">Callback executed after the information has been retrieved</param> public void GetStockInfo(string symbol, DataAccessor.StockInfoCallback callback) { if (Client.isAuthenticated) { Client.DownloadQuote(symbol).ContinueWith((results) => { if (results.IsCompleted && !results.IsFaulted) { // Put the data into a table var response = results.Result; DataAccessor.StockInfo info = new DataAccessor.StockInfo() { Ask = response.AskPrice, AskVolume = response.AskSize, Bid = response.BidPrice, BidVolume = response.BidSize, PreviousClose = response.AdjustedPreviousClose }; // Send the results back callback(info); } else { callback(new DataAccessor.StockInfo()); } }); } }
/// <summary> /// Retrieves information about a stock /// </summary> /// <param name="symbol">The symbol to retrieve the info for</param> /// <param name="callback">Callback executed after the information has been retrieved</param> public void GetStockInfo(string symbol, DataAccessor.StockInfoCallback callback) { Source.GetStockInfo(symbol, callback); }