Beispiel #1
0
        //
        //
        #endregion//Constructors


        #region Properties
        // *****************************************************************
        // ****                     Properties                          ****
        // *****************************************************************
        //
        //
        #endregion//Properties


        #region Public Methods
        // *****************************************************************
        // ****                     Public Methods                      ****
        // *****************************************************************
        //
        //
        //
        //
        //
        //
        #endregion//Public Methods


        #region Private Methods
        // *****************************************************************
        // ****                     Private Methods                     ****
        // *****************************************************************
        //

        //
        private void Shutdown()
        {
            m_IsShuttingDown = true;
            if (m_Writer != null)
            {
                m_Writer.RequestStop();
                m_Writer = null;
            }
            if (m_TTService != null)
            {
                m_TTService.Dispose();
                m_TTService = null;
            }
            if (m_PriceListener != null)
            {
                m_PriceListener.Dispose();
                m_PriceListener = null;
            }
            if (m_FillListener != null)
            {
                m_FillListener.Dispose();
                m_FillListener = null;
            }
            if (m_OrderListener != null)
            {
                m_OrderListener.Dispose();
                m_OrderListener = null;
            }
            if (Log != null)
            {
                Log.RequestStop();
                Log = null;
            }
        }
Beispiel #2
0
        // *****************************************************************
        // ****                     Private Methods                     ****
        // *****************************************************************
        //
        //
        //
        //
        //
        // ****                   ShutDown()                       ****
        //
        /// <summary>
        /// Called when the form is about to close to release resources nicely.
        /// </summary>
        private void ShutDown()
        {
            if (!m_IsAppShuttingDown)
            {
                m_IsAppShuttingDown = true;

                if (Log != null)
                {
                    Log.RequestStop();
                    Log = null;
                }

                if (m_FillHub != null)
                {
                    //m_FillHub.PositionBookCreated -= new EventHandler(FillHub_PositionBookCreated);
                    //m_FillHub.PositionBookChanged -= new EventHandler(FillHub_PositionBookChanged);
                    //m_FillHub.PositionBookPnLChanged -= new EventHandler(FillHub_PositionBookPnLChanged);
                    m_FillHub.Request(new Misty.Lib.OrderHubs.OrderHubRequest(Misty.Lib.OrderHubs.OrderHubRequest.RequestType.RequestShutdown));
                    m_FillHub = null;
                }
                if (m_MarketHub != null)
                {
                    m_MarketHub.RequestStop();
                    m_MarketHub = null;
                }
                if (m_TTServices != null)
                {
                    m_TTServices.ServiceStateChanged -= new EventHandler(TTServices_ServiceStateChanged);
                    m_TTServices.Dispose();
                    m_TTServices = null;
                }
                if (m_TalkerHub != null)
                {
                    m_TalkerHub.ServiceStateChanged -= new EventHandler(TalkerHub_ServiceStateChanged);
                    m_TalkerHub.Request(TalkerHubRequest.StopService);
                    //m_TalkerHub = null;
                }
            }
        }//Shutdown().
Beispiel #3
0
        //
        //
        //
        #endregion//Constructors



        #region no Public Methods
        // *****************************************************************
        // ****                     Public Methods                      ****
        // *****************************************************************
        //
        //
        //
        //
        //
        //
        #endregion//Public Methods


        #region Private Methods
        // *****************************************************************
        // ****                     Private Methods                     ****
        // *****************************************************************
        //
        //
        //
        // ****             Shutdown()              ****
        //
        /// <summary>
        /// Complete shutdown of all hubs and their threads.
        /// </summary>
        private void Shutdown()
        {
            if (m_Market != null)
            {
                m_Market.RequestStop();
            }
            TTApiService ttService = TTApiService.GetInstance();

            if (ttService != null)
            {
                ttService.Dispose();
            }
            if (timer1 != null)
            {
                timer1.Stop();
                timer1.Enabled = false;
                timer1.Dispose();
            }
        }// Shutdown()