예제 #1
0
        }// Start()

        //
        //
        //
        public void Dispose()
        {
            if (m_isDisposing)
            {
                return;
            }
            m_isDisposing = true;

            m_Dispatcher.BeginInvoke(new Action(StopThread));
            m_Dispatcher.Run();

            m_TradeSubsciption.Dispose();
        }//Dispose()
예제 #2
0
        }//InitComplete()

        /// <summary>
        /// Called by the Dispose() function.
        /// </summary>
        private void StopThread()
        {
            if (m_Dispatcher != null && (!m_Dispatcher.IsDisposed))
            {
                m_Dispatcher.Dispose();
            }
            if (m_TradeSubsciption != null)
            {
                if (Log != null)
                {
                    Log.NewEntry(LogLevel.Minor, "FillListener: {0} shutting down TradeSubscription.", this);
                }
                m_TradeSubsciption.OrderFilled      -= new EventHandler <TradingTechnologies.TTAPI.OrderFilledEventArgs>(TT_OrderFilled);
                m_TradeSubsciption.Rollover         -= new EventHandler <RolloverEventArgs>(TT_Rollover);
                m_TradeSubsciption.FillRecordAdded  -= new EventHandler <FillAddedEventArgs>(TT_RecordedFill);
                m_TradeSubsciption.AdminFillAdded   -= new EventHandler <FillAddedEventArgs>(TT_AdminFill);
                m_TradeSubsciption.AdminFillDeleted -= new EventHandler <FillDeletedEventArgs>(TT_AdminFillDeleted);

                m_TradeSubsciption.FillBookDownload -= new EventHandler <TradingTechnologies.TTAPI.FillBookDownloadEventArgs>(TT_FillListDownLoad);
                m_TradeSubsciption.FillListStart    -= new EventHandler <TradingTechnologies.TTAPI.FillListEventArgs>(TT_FillListStart);
                m_TradeSubsciption.FillListEnd      -= new EventHandler <TradingTechnologies.TTAPI.FillListEventArgs>(TT_FillListEnd);

                m_TradeSubsciption.Dispose();
                m_TradeSubsciption = null;
            }
        }//StopThread()
예제 #3
0
        /// <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_tradeSubscription != null)
                {
                    m_tradeSubscription.OrderAdded         -= tradeSubscription_OrderAdded;
                    m_tradeSubscription.OrderBookDownload  -= tradeSubscription_OrderBookDownload;
                    m_tradeSubscription.OrderDeleted       -= tradeSubscription_OrderDeleted;
                    m_tradeSubscription.OrderFilled        -= tradeSubscription_OrderFilled;
                    m_tradeSubscription.OrderRejected      -= tradeSubscription_OrderRejected;
                    m_tradeSubscription.OrderUpdated       -= tradeSubscription_OrderUpdated;
                    m_tradeSubscription.OrderStatusUnknown -= tradeSubscription_OrderStatusUnknown;

                    m_tradeSubscription.Dispose();
                    m_tradeSubscription = null;
                }

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

            // only run shutdown once
            m_shutdownInProcess = true;
        }
        private void Shutdown()
        {
            if (m_ts != null)
            {
                m_ts.OrderBookDownload  -= OnOrderBookDownload;
                m_ts.OrderAdded         -= OnOrderAdded;
                m_ts.OrderDeleted       -= OnOrderDeleted;
                m_ts.OrderFilled        -= OnOrderFilled;
                m_ts.OrderUpdated       -= OnOrderUpdated;
                m_ts.OrderPendingAction -= OnOrderPendingAction;
                m_ts.OrderRejected      -= OnOrderRejected;
                m_ts.Dispose();
                m_ts = null;
            }

            TTAPI.Shutdown();
        }
        /// <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_tradeSubscription != null)
                {
                    m_tradeSubscription.FillRecordAdded  -= m_tradeSubscription_FillRecordAdded;
                    m_tradeSubscription.AdminFillAdded   -= m_tradeSubscription_AdminFillAdded;
                    m_tradeSubscription.AdminFillDeleted -= m_tradeSubscription_AdminFillDeleted;
                    m_tradeSubscription.FillBookDownload -= m_tradeSubscription_FillBookDownload;
                    m_tradeSubscription.FillAmended      -= m_tradeSubscription_FillAmended;
                    m_tradeSubscription.Dispose();
                    m_tradeSubscription = null;
                }

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

            // only run shutdown once
            m_shutdownInProcess = true;
        }