public void onTaskFailed(UpdateInstrumentsTask task, QuotesManagerError error)
 {
     mRunning = false;
     if (OnErrorEvent != null)
     {
         OnErrorEvent(String.Format("{0}({1}) : {2}", error.Code, error.SubCode, error.Message));
     }
 }
 /// <summary>
 /// Listener: when the remove task is failed.
 /// </summary>
 /// <param name="task"></param>
 /// <param name="error"></param>
 public void onTaskFailed(UpdateInstrumentsTask task, QuotesManagerError error)
 {
     if (error != null)
     {
         string errorMessage = String.Format("{0}({1}) : {2}", error.Code, error.SubCode, error.Message);
         Console.WriteLine("Error occurred : {0}", errorMessage);
         mEvent.Set();
     }
 }
 /// <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);
     }
 }
Exemplo n.º 4
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);
        }
 public void onTaskCompleted(UpdateInstrumentsTask task)
 {
     mRunning = false;
     PrepareListOfInstruments();
 }
 public void onTaskCanceled(UpdateInstrumentsTask task)
 {
     mRunning = false;
 }
 /// <summary>
 /// Listener: when the remove task is completed.
 /// </summary>
 /// <param name="task"></param>
 public void onTaskCompleted(UpdateInstrumentsTask task)
 {
     Console.WriteLine("Update instruments task was completed.");
     mEvent.Set();
 }