AddSubscription method

void AddSubscription(
  1. StreamingSubscription subscription
)
Adds a subscription to this connection. The subscription to add.

Implementation

void AddSubscription(StreamingSubscription subscription) {
  this.ThrowIfDisposed();

  EwsUtilities.ValidateParam(subscription, "subscription");

  this.ValidateConnectionState(
      false, "Strings.CannotAddSubscriptionToLiveConnection");

  if (this._subscriptions.containsKey(subscription.Id)) {
    return;
  }
  this._subscriptions[subscription.Id!] = subscription;
}