/// <summary>
        /// Shuts down the TT API
        /// </summary>
        public void Dispose()
        {
            lock (m_lock)
            {
                if (!m_disposed)
                {
                    // Unattached callbacks and dispose of all subscriptions
                    if (m_ts != null)
                    {
                        m_ts.Update -= m_ts_Update;
                        m_ts.Dispose();
                        m_ts = null;
                    }
                    if (m_req != null)
                    {
                        m_req.Update -= m_req_Update;
                        m_req.Dispose();
                        m_req = null;
                    }

                    // Begin shutdown the TT API
                    TTAPI.ShutdownCompleted += new EventHandler(TTAPI_ShutdownCompleted);
                    TTAPI.Shutdown();

                    m_disposed = true;
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Clean up TTAPI objects
 /// </summary>
 public void Dispose()
 {
     lock (m_lock)
     {
         if (!m_disposed)
         {
             // Detach callbacks and dispose of all subscriptions
             if (m_req != null)
             {
                 m_req.Dispose();
                 m_req = null;
             }
             if (m_tsSub != null)
             {
                 m_tsSub.Dispose();
             }
             m_tsSub = null;
         }
         // Shutdown the Dispatcher
         if (m_disp != null)
         {
             m_disp.BeginInvokeShutdown();
             m_disp = null;
         }
         m_disposed = true;
     }
 }
        /// <summary>
        /// Dispose of all the TT API objects and shutdown the TT API
        /// </summary>
        public void shutdownTTAPI()
        {
            if (!m_shutdownInProcess)
            {
                // Dispose of all request objects
                if (m_timeAndSalesSubscription != null)
                {
                    m_timeAndSalesSubscription.Update -= timeAndSalesSubscription_Update;
                    m_timeAndSalesSubscription.Dispose();
                    m_timeAndSalesSubscription = null;
                }

                TTAPI.ShutdownCompleted += new EventHandler(TTAPI_ShutdownCompleted);
                TTAPI.Shutdown();
            }

            // only run shutdown once
            m_shutdownInProcess = true;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Shuts down the TT API and disposes the subscriptions </summary>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public void Dispose()
        {
            if (object.ReferenceEquals(m_instrLookupRequest, null) == false)
            {
                m_instrLookupRequest.Dispose();
            }

            if (object.ReferenceEquals(m_tsSubscription, null) == false)
            {
                m_tsSubscription.Dispose();
            }

            TTAPI.Shutdown();
        }