Exemple #1
0
        public void LockServer(bool bLock)
        {
            if (bLock)
            {
                ManagedCOMLocalServer.InterlockedIncrementServerLockCount();
            }
            else
            {
                ManagedCOMLocalServer.InterlockedDecrementServerLockCount();
            }

            // Always attempt to see if we need to shutdown this server application.
            ManagedCOMLocalServer.AttemptToTerminateServer();
        }
Exemple #2
0
        public XApiCom()
        {
            MessageQueue = new ConcurrentQueue <QueueData>();

            api = new XApi();

            api.OnConnectionStatus = OnConnectionStatus_callback;
            api.OnRtnError         = OnRtnError_callback;
            api.OnLog = OnLog_callback;

            api.OnRtnDepthMarketData = OnRtnDepthMarketData_callback;
            //base.OnRtnQuoteRequest = OnRtnQuoteRequest_callback;

            api.OnRspQryInstrument       = OnRspQryInstrument_callback;
            api.OnRspQryTradingAccount   = OnRspQryTradingAccount_callback;
            api.OnRspQryInvestorPosition = OnRspQryInvestorPosition_callback;
            //base.OnRspQrySettlementInfo = OnRspQrySettlementInfo_callback;

            api.OnRspQryOrder = OnRspQryOrder_callback;
            api.OnRspQryTrade = OnRspQryTrade_callback;
            //base.OnRspQryQuote = OnRspQryQuote_callback;

            api.OnRtnOrder = OnRtnOrder_callback;
            api.OnRtnTrade = OnRtnTrade_callback;
            //base.OnRtnQuote = OnRtnQuote_callback;

            //base.OnRspQryHistoricalTicks = OnRspQryHistoricalTicks_callback;
            //base.OnRspQryHistoricalBars = OnRspQryHistoricalBars_callback;

            //base.OnRspQryInvestor = OnRspQryInvestor_callback;

            InitializeComponent();


            Console.WriteLine("ReferenceCountedObjectBase contructor.");
            // We increment the global count of objects.
            ManagedCOMLocalServer.InterlockedIncrementObjectsCount();
        }