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"); } } }
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"); } } }