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
ExchangeServiceThe ExchangeService instance this connection uses to connect to the server.
subscriptions
IEnumerable<StreamingSubscription>The streaming subscriptions this connection is receiving events for.
lifetime
intThe 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
ExchangeServiceThe ExchangeService instance this connection uses to connect to the server.
lifetime
intThe 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
IsOpen
Gets a value indicating whether this connection is opened
public bool IsOpen { get; }
Property Value
Methods
AddSubscription(StreamingSubscription)
Adds a subscription to this connection.
public void AddSubscription(StreamingSubscription subscription)
Parameters
subscription
StreamingSubscriptionThe 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
StreamingSubscriptionThe 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
OnNotificationEvent
Occurs when notifications are received from the server.
public event StreamingSubscriptionConnection.NotificationEventDelegate OnNotificationEvent
Event Type
OnSubscriptionError
Occurs when a subscription encounters an error.
public event StreamingSubscriptionConnection.SubscriptionErrorDelegate OnSubscriptionError