예제 #1
0
        //private void SubscribeToAsyncCompletedEvents()
        //{
        //    /*** Global API ***/
        //    _bfGlobalService.keepAliveCompleted += new Betfair.API.BetfairGlobalAPI.keepAliveCompletedEventHandler(OnAsyncCallBackComplete);

        //    /*** Exchange API ***/
        //    for (int x = 1; x < _bfExchangeService.Length; x++)
        //    {
        //        _bfExchangeService[x].getAllMarketsCompleted += new Betfair.API.BetfairExchangeAPI.getAllMarketsCompletedEventHandler(OnAsyncCallBackComplete);
        //        _bfExchangeService[x].getMarketCompleted += new Betfair.API.BetfairExchangeAPI.getMarketCompletedEventHandler(OnAsyncCallBackComplete);
        //        _bfExchangeService[x].getAllMarketsCompleted += new Betfair.API.BetfairExchangeAPI.getAllMarketsCompletedEventHandler(OnAsyncCallBackComplete);
        //        _bfExchangeService[x].getMarketPricesCompressedCompleted += new Betfair.API.BetfairExchangeAPI.getMarketPricesCompressedCompletedEventHandler(OnAsyncCallBackComplete);
        //        _bfExchangeService[x].getCompleteMarketPricesCompressedCompleted += new Betfair.API.BetfairExchangeAPI.getCompleteMarketPricesCompressedCompletedEventHandler(OnAsyncCallBackComplete);
        //        _bfExchangeService[x].getMarketTradedVolumeCompressedCompleted += new Betfair.API.BetfairExchangeAPI.getMarketTradedVolumeCompressedCompletedEventHandler(OnAsyncCallBackComplete);
        //        _bfExchangeService[x].getSilksCompleted += new Betfair.API.BetfairExchangeAPI.getSilksCompletedEventHandler(OnAsyncCallBackComplete);
        //    }
        //}

        #endregion

        #region GetHeader

        /// <summary>
        /// Returns Betfair.API.BetfairGlobalAPI.APIRequestHeader if isGlobal = true
        /// else Betfair.API.BetfairExchangeAPI.APIRequestHeader
        /// </summary>
        /// <param name="isGlobal"></param>
        /// <returns></returns>
        private static object GetHeader(bool isGlobal)
        {
            if (isGlobal)
            {
                var header = new APIRequestHeader {
                    sessionToken = _sessionToken
                };
                return(header);
            }
            else
            {
                var header = new BetfairExchangeAPI.APIRequestHeader {
                    sessionToken = _sessionToken
                };
                return(header);
            }
        }
예제 #2
0
 /// <summary>
 /// Returns Betfair.API.BetfairGlobalAPI.APIRequestHeader if isGlobal = true
 /// else Betfair.API.BetfairExchangeAPI.APIRequestHeader
 /// </summary>
 /// <param name="isGlobal"></param>
 /// <returns></returns>
 private static object GetHeader(bool isGlobal)
 {
     if (isGlobal)
     {
         var header = new APIRequestHeader {sessionToken = _sessionToken};
         return header;
     }
     else
     {
         var header = new BetfairExchangeAPI.APIRequestHeader {sessionToken = _sessionToken};
         return header;
     }
 }