コード例 #1
0
        /// <summary>
        /// Upon the application form loading, the TTGate, TTDropHandler, TTInstrNotify, and
        /// TTRiskManager are initialized and events are subscribed to.
        /// </summary>
        public frmStartOfDay()
        {
            // Required for Windows Form Designer support
            InitializeComponent();

            // Indicates when the connection is established
            m_TTGate = new XTAPI.TTGate();

            //Subscribe to the OnExchangeStateupdate and OnStatusUpdate events
            m_TTGate.OnExchangeStateUpdate += new XTAPI._ITTGateEvents_OnExchangeStateUpdateEventHandler(m_TTGate_OnExchangeStateUpdate);
            m_TTGate.OnStatusUpdate += new XTAPI._ITTGateEvents_OnStatusUpdateEventHandler(m_TTGate_OnStatusUpdate);

            // Instantiate the drag and drop handler class.
            m_TTDropHandler = new XTAPI.TTDropHandler();

            // Register the active form for drag and drop.
            m_TTDropHandler.RegisterDropWindow((int)this.Handle);

            // Associate the drop and drag callback event.
            m_TTDropHandler.OnNotifyDrop += new XTAPI._ITTDropHandlerEvents_OnNotifyDropEventHandler(m_TTDropHandler_OnNotifyDrop);

            // Instantiate the instrument notification class.
            m_TTInstrNotify = new XTAPI.TTInstrNotify();

            // Setup the instrument notification call back functions.
            m_TTInstrNotify.OnNotifyFound += new XTAPI._ITTInstrNotifyEvents_OnNotifyFoundEventHandler(m_TTInstrNotify_OnNotifyFound);

            //Instantiate the TTRiskManagerClass
            m_RiskManager = new XTAPI.TTRiskManager();

            //Subscribe to the TTRiskManager Events
            m_RiskManager.OnLoginFailed += new XTAPI._ITTRiskManagerEvents_OnLoginFailedEventHandler(m_RiskManager_OnLoginFailed);
            m_RiskManager.OnDataLoaded += new XTAPI._ITTRiskManagerEvents_OnDataLoadedEventHandler(m_RiskManager_OnDataLoaded);
            m_RiskManager.OnSODDataDownloaded += new XTAPI._ITTRiskManagerEvents_OnSODDataDownloadedEventHandler(m_RiskManager_OnSODDataDownloaded);
        }
コード例 #2
0
        /// <summary>
        /// Upon the application form loading, the TTDropHandler and TTInstrNotify objects 
        /// are initialized, and the required events are subscribed.
        /// </summary>
        public frmTimeAndSales()
        {
            // Required for Windows Form Designer support
            InitializeComponent();

            // Instantiate the drag and drop handler class.
            m_TTDropHandler = new XTAPI.TTDropHandlerClass();

            // Register the active form for drag and drop.
            m_TTDropHandler.RegisterDropWindow((int)this.Handle);

            // Subscribe to the drop and drag callback event.
            m_TTDropHandler.OnNotifyDrop +=new XTAPI._ITTDropHandlerEvents_OnNotifyDropEventHandler(m_TTDropHandler_OnNotifyDrop);

            // Instantiate the instrument notification class
            m_TTInstrNotify = new XTAPI.TTInstrNotifyClass();

            // Turn on trade data updates
            m_TTInstrNotify.DeliverAllPriceUpdates = 1;
            m_TTInstrNotify.EnablePriceUpdates = 1;

            // Setup instrument notifier callbacks
            m_TTInstrNotify.OnNotifyFound +=new XTAPI._ITTInstrNotifyEvents_OnNotifyFoundEventHandler(m_TTInstrNotify_OnNotifyFound);
            m_TTInstrNotify.OnPriceListUpdate +=new XTAPI._ITTInstrNotifyEvents_OnPriceListUpdateEventHandler(m_TTInstrNotify_OnPriceListUpdate);
        }