Пример #1
0
 private void cbTradeSubscription_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (_igStreamApiClient != null)
         {
             if (cbTradeSubscription.CheckState == CheckState.Checked)
             {
                 _tradeConfirmsSubscription = new TradeConfirmsSubscription(this);
                 _tradeSubscriptionStk      = _igStreamApiClient.subscribeToTradeSubscription(_currentAccount,
                                                                                              _tradeConfirmsSubscription);
                 AppendActivityMessage("TradeSubscription : Subscribe");
             }
             else
             {
                 if (_tradeSubscriptionStk != null)
                 {
                     _igStreamApiClient.UnsubscribeTableKey(_tradeSubscriptionStk);
                     AppendActivityMessage("TradeSubscription : Unsubscribe");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         AppendStreamingDataMessage(ex.Message);
     }
 }
Пример #2
0
 private void cbTradeSubscription_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (_igStreamApiClient != null)
         {
             if (cbTradeSubscription.CheckState == CheckState.Checked)
             {
                 _tradeConfirmsSubscription = new TradeConfirmsSubscription(this);
                 _tradeSubscriptionStk = _igStreamApiClient.subscribeToTradeSubscription(_currentAccount,
                                                                                         _tradeConfirmsSubscription);
                 AppendActivityMessage("TradeSubscription : Subscribe");
             }
             else
             {
                 if (_tradeSubscriptionStk != null)
                 {
                     _igStreamApiClient.UnsubscribeTableKey(_tradeSubscriptionStk);
                     AppendActivityMessage("TradeSubscription : Unsubscribe");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         AppendStreamingDataMessage(ex.Message);
     }
 }