C# Class Particle.ParticleEventManager

This class is used to manage the stream of events from the Particle Cloud and Turn them into native .net events
Afficher le fichier Open project: ParticleNET/ParticleSDK Class Usage Examples

Protected Properties

Свойство Type Description
_stop bool

Méthodes publiques

Méthode Description
ParticleEventManager ( Uri streamUri, String accessToken ) : Newtonsoft.Json

Initializes a new instance of the ParticleEventManager class.

Start ( ) : void

Starts listening to the events coming in from the specified stream

Stop ( ) : void

Stops listening to the event stream

Méthodes protégées

Méthode Description
ConnectToClient ( ) : System.Threading.Tasks.Task

Connects to client.

ListensToStreamAsync ( Stream eventStream ) : System.Threading.Tasks.Task

Listenses to stream for Web Events

ParticleEventManager ( ) : Newtonsoft.Json

Initializes a new instance of the ParticleEventManager class. Without requiring the Access Token, or Uri mostly used for unit tests

fireEvent ( String eventName, ParticleEventData data ) : void

Fires the event.

Method Details

ConnectToClient() protected méthode

Connects to client.
protected ConnectToClient ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

ListensToStreamAsync() protected méthode

Listenses to stream for Web Events
protected ListensToStreamAsync ( Stream eventStream ) : System.Threading.Tasks.Task
eventStream Stream The event stream.
Résultat System.Threading.Tasks.Task

ParticleEventManager() protected méthode

Initializes a new instance of the ParticleEventManager class. Without requiring the Access Token, or Uri mostly used for unit tests
protected ParticleEventManager ( ) : Newtonsoft.Json
Résultat Newtonsoft.Json

ParticleEventManager() public méthode

Initializes a new instance of the ParticleEventManager class.
public ParticleEventManager ( Uri streamUri, String accessToken ) : Newtonsoft.Json
streamUri System.Uri The stream URI. i.e. https://api.particle.io/v1/devices/events
accessToken String The access token for authentication.
Résultat Newtonsoft.Json

Start() public méthode

Starts listening to the events coming in from the specified stream
public Start ( ) : void
Résultat void

Stop() public méthode

Stops listening to the event stream
public Stop ( ) : void
Résultat void

fireEvent() protected méthode

Fires the event.
protected fireEvent ( String eventName, ParticleEventData data ) : void
eventName String Name of the event.
data ParticleEventData The data.
Résultat void

Property Details

_stop protected_oe property

Used to determen if we should keep running. If this is false we keep restarting and connecting to the event service If this is true stop listening to the event service
protected bool _stop
Résultat bool