StreamingSubscriptionConnection constructor
StreamingSubscriptionConnection(
- ExchangeService service,
- int lifetime
Implementation
// delegate void NotificationEventDelegate(object sender, NotificationEventArgs args);
/// <summary>
/// Represents a delegate that is invoked when an error occurs within a streaming subscription connection.
/// </summary>
/// <param name="sender">The StreamingSubscriptionConnection instance within which the error occurred.</param>
/// <param name="args">The event data.</param>
// delegate void SubscriptionErrorDelegate(object sender, SubscriptionErrorEventArgs args);
/// <summary>
/// Occurs when notifications are received from the server.
/// </summary>
// event NotificationEventDelegate OnNotificationEvent;
/// <summary>
/// Occurs when a subscription encounters an error.
/// </summary>
// event SubscriptionErrorDelegate OnSubscriptionError;
/// <summary>
/// Occurs when a streaming subscription connection is disconnected from the server.
/// </summary>
// event SubscriptionErrorDelegate OnDisconnect;
/// <summary>
/// Initializes a new instance of the <see cref="StreamingSubscriptionConnection"/> class.
/// </summary>
/// <param name="service">The ExchangeService instance this connection uses to connect to the server.</param>
/// <param name="lifetime">The maximum time, in minutes, the connection will remain open. Lifetime must be between 1 and 30.</param>
StreamingSubscriptionConnection(ExchangeService service, int lifetime) {
EwsUtilities.ValidateParam(service, "service");
EwsUtilities.ValidateClassVersion(
service, ExchangeVersion.Exchange2010_SP1, this.runtimeType.toString());
if (lifetime < 1 || lifetime > 30) {
throw new RangeError.range(lifetime, 1, 30, "lifetime");
}
this._session = service;
this._subscriptions = new Map<String?, StreamingSubscription>();
this._connectionTimeout = lifetime;
}