コード例 #1
0
 /// <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>
        /// Tries to start next remove task.
        /// </summary>
        /// <param name="quotesManager">The QuotesManager instance</param>
        /// <param name="removeTasks">Collection of remove tasks</param>
        /// <param name="removeQuoteListener">Listener of remove quotes task</param>
        private static void StartNextRemoveTask(QuotesManager quotesManager, Queue <RemoveQuotesTask> removeTasks, RemoveQuotesListener removeQuoteListener)
        {
            RemoveQuotesTask removeTask = removeTasks.Dequeue();

            quotesManager.executeTask(removeTask);
            removeQuoteListener.WaitEvents();
        }
コード例 #3
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);
        }