/// <summary>
 /// Gets the list of the data stored in the cache.
 /// The result will be sent to OnListPreparedEvent
 /// </summary>
 public void GetListOfData()
 {
     if (mMgr.areInstrumentsUpdated())
     {
         PrepareListOfInstruments();
     }
     else
     {
         mRunning = true;
         UpdateInstrumentsTask task = mMgr.createUpdateInstrumentsTask(this);
         mMgr.executeTask(task);
     }
 }
Пример #2
0
        /// <summary>
        /// Shows quotes that are available in local cache.
        /// </summary>
        /// <param name="quotesManager">QuotesManager instance</param>
        static void ShowLocalQuotes(QuotesManager quotesManager)
        {
            if (quotesManager == null)
            {
                Console.WriteLine("Failed to get local quotes");
                return;
            }

            // if the instruments list is not updated, update it now
            if (!quotesManager.areInstrumentsUpdated())
            {
                UpdateInstrumentsListener instrumentsCallback = new UpdateInstrumentsListener();
                UpdateInstrumentsTask     task = quotesManager.createUpdateInstrumentsTask(instrumentsCallback);
                quotesManager.executeTask(task);
                instrumentsCallback.WaitEvents();
            }

            IQMDataCollection collection = PrepareListOfQMData(quotesManager);

            ShowPreparedQMDataList(collection);
        }