Table of Contents

Class StreamingSubscriptionConnection

Namespace
Microsoft.Exchange.WebServices.Data
Assembly
Microsoft.Exchange.WebServices.dll

Represents a connection to an ongoing stream of events.

public sealed class StreamingSubscriptionConnection : IDisposable
Inheritance
StreamingSubscriptionConnection
Implements
Inherited Members

Constructors

StreamingSubscriptionConnection(ExchangeService, IEnumerable<StreamingSubscription>, int)

Initializes a new instance of the StreamingSubscriptionConnection class.

public StreamingSubscriptionConnection(ExchangeService service, IEnumerable<StreamingSubscription> subscriptions, int lifetime)

Parameters

service ExchangeService

The ExchangeService instance this connection uses to connect to the server.

subscriptions IEnumerable<StreamingSubscription>

The streaming subscriptions this connection is receiving events for.

lifetime int

The maximum time, in minutes, the connection will remain open. Lifetime must be between 1 and 30.

StreamingSubscriptionConnection(ExchangeService, int)

Initializes a new instance of the StreamingSubscriptionConnection class.

public StreamingSubscriptionConnection(ExchangeService service, int lifetime)

Parameters

service ExchangeService

The ExchangeService instance this connection uses to connect to the server.

lifetime int

The maximum time, in minutes, the connection will remain open. Lifetime must be between 1 and 30.

Properties

CurrentSubscriptions

Getting the current subscriptions in this connection.

public IEnumerable<StreamingSubscription> CurrentSubscriptions { get; }

Property Value

IEnumerable<StreamingSubscription>

IsOpen

Gets a value indicating whether this connection is opened

public bool IsOpen { get; }

Property Value

bool

Methods

AddSubscription(StreamingSubscription)

Adds a subscription to this connection.

public void AddSubscription(StreamingSubscription subscription)

Parameters

subscription StreamingSubscription

The subscription to add.

Exceptions

InvalidOperationException

Thrown when AddSubscription is called while connected.

Close()

Closes this connection so it stops receiving events from the server. This terminates a long-standing call to EWS.

public void Close()

Exceptions

InvalidOperationException

Thrown when Close is called while not connected.

Dispose()

Frees resources associated with this StreamingSubscriptionConnection.

public void Dispose()

~StreamingSubscriptionConnection()

Finalizes an instance of the StreamingSubscriptionConnection class.

protected ~StreamingSubscriptionConnection()

Open()

Opens this connection so it starts receiving events from the server. This results in a long-standing call to EWS.

public void Open()

Exceptions

InvalidOperationException

Thrown when Open is called while connected.

RemoveSubscription(StreamingSubscription)

Removes the specified streaming subscription from the connection.

public void RemoveSubscription(StreamingSubscription subscription)

Parameters

subscription StreamingSubscription

The subscription to remove.

Exceptions

InvalidOperationException

Thrown when RemoveSubscription is called while connected.

Events

OnDisconnect

Occurs when a streaming subscription connection is disconnected from the server.

public event StreamingSubscriptionConnection.SubscriptionErrorDelegate OnDisconnect

Event Type

StreamingSubscriptionConnection.SubscriptionErrorDelegate

OnNotificationEvent

Occurs when notifications are received from the server.

public event StreamingSubscriptionConnection.NotificationEventDelegate OnNotificationEvent

Event Type

StreamingSubscriptionConnection.NotificationEventDelegate

OnSubscriptionError

Occurs when a subscription encounters an error.

public event StreamingSubscriptionConnection.SubscriptionErrorDelegate OnSubscriptionError

Event Type

StreamingSubscriptionConnection.SubscriptionErrorDelegate