Esempio n. 1
0
 private void cbAccountSubscription_CheckedChanged(object sender, EventArgs e)
 {
     if (cbAccountSubscription.CheckState == CheckState.Checked)
     {
         try
         {
             if (_currentAccount != null)
             {
                 _accountBalanceSubscription = new AccountBalanceSubscription(this);
                 if (_igStreamApiClient != null)
                 {
                     _accountsStk = _igStreamApiClient.subscribeToAccountDetailsKey(_currentAccount,
                                                                                    _accountBalanceSubscription);
                     AppendActivityMessage("AccountDetails : Successfully Subscribed");
                 }
             }
         }
         catch (Exception ex)
         {
             AppendStreamingDataMessage(ex.Message);
         }
     }
     else
     {
         if ((_accountsStk != null) && (_igStreamApiClient != null))
         {
             _igStreamApiClient.UnsubscribeTableKey(_accountsStk);
             AppendActivityMessage("AccountDetails : Unsubscribe");
         }
     }
 }
Esempio n. 2
0
 private void cbAccountSubscription_CheckedChanged(object sender, EventArgs e)
 {
     if (cbAccountSubscription.CheckState == CheckState.Checked)
     {
         try
         {
             if (_currentAccount != null)
             {
                 _accountBalanceSubscription = new AccountBalanceSubscription(this);
                 if (_igStreamApiClient != null)
                 {
                     _accountsStk = _igStreamApiClient.subscribeToAccountDetailsKey(_currentAccount,
                                                                                    _accountBalanceSubscription);
                     AppendActivityMessage("AccountDetails : Successfully Subscribed");
                 }
             }
         }
         catch (Exception ex)
         {
             AppendStreamingDataMessage(ex.Message);
         }
     }
     else
     {
         if ((_accountsStk != null) && ( _igStreamApiClient != null))
         {
             _igStreamApiClient.UnsubscribeTableKey(_accountsStk);
             AppendActivityMessage("AccountDetails : Unsubscribe");
         }
     }
 }