public void StopSubscriber()
        {
            try
            {
                lock (m_quoteServerLock)
                {
                    if (IsSubscribed)
                    {
                        IsSubscribed            = false;
                        QuoteServiceStoppedTime = DateTime.Now.TimeOfDay;
                        m_messageUtilities1.StopSubscriber();
                        m_messageUtilities2.StopSubscriber();

                        lock (m_portfolioLock)
                        {
                            foreach (HugoDataSet.PortfolioRow row in m_portfolio.Rows)
                            {
                                row.SubscriptionStatus = SubscriptionStatus.Unsubscribed.ToString();
                                row.UpdateTime         = DateTime.Now - DateTime.Today;
                            }

                            foreach (HugoDataSet.IndicesRow row in m_indices.Rows)
                            {
                                row.SubscriptionStatus = SubscriptionStatus.Unsubscribed.ToString();
                                row.UpdateTime         = DateTime.Now - DateTime.Today;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                PositionMonitorUtilities.Error(Name + " enountered an error stopping subscriber", ex);
            }
        }
Esempio n. 2
0
 public void StopSubscriber()
 {
     try
     {
         if (IsSubscribed)
         {
             IsSubscribed = false;
             m_messageUtilities.StopSubscriber();
         }
     }
     catch (Exception ex)
     {
         PositionMonitorUtilities.Error(Name + " enountered an error stopping subscriber", ex);
     }
 }
Esempio n. 3
0
 private void StopWriter()
 {
     if (m_bWriterStarted)
     {
         try
         {
             m_bWriterStarted = false;
             m_writer.StopPublisher();
             m_writer.StopSubscriber();
         }
         catch (Exception ex)
         {
             OnError("Unable to stop writer", ex);
         }
     }
 }
Esempio n. 4
0
 private void buttonStop_Click(object sender, EventArgs e)
 {
     try
     {
         if (radioButtonNativeBloomberg.Checked)
         {
             m_nativeUtilities.Disconnect();
         }
         else
         {
             m_messageUtilities.StopSubscriber();
         }
     }
     catch (Exception ex)
     {
         OnError("Error in stop processing", ex);
     }
     finally
     {
         EnableControls();
     }
 }