Exemple #1
0
 /// <summary>
 ///   Publishes an event to a single actor on a specified channel.
 /// </summary>
 /// <param name = "e">
 ///   The event to publish.
 /// </param>
 /// <param name = "actor">
 ///   The <see cref = "Actor" /> who should receive the event.
 /// </param>
 /// <param name = "sendParameters">
 ///   The send Parameters.
 /// </param>
 protected void PublishEvent(LiteEventBase e, Actor actor, SendParameters sendParameters)
 {
     var eventData = new EventData(e.Code, e);
     actor.Peer.SendEvent(eventData, sendParameters);
 }
Exemple #2
0
 /// <summary>
 ///   Publishes an event to a list of actors on a specified channel.
 /// </summary>
 /// <param name = "e">
 ///   The event to publish.
 /// </param>
 /// <param name = "actorList">
 ///   A list of <see cref = "Actor" /> who should receive the event.
 /// </param>
 /// <param name = "sendParameters">
 ///   The send Parameters.
 /// </param>
 protected void PublishEvent(LiteEventBase e, IEnumerable<Actor> actorList, SendParameters sendParameters)
 {
     IEnumerable<PeerBase> peers = actorList.Select(actor => actor.Peer);
     var eventData = new EventData(e.Code, e);
     ApplicationBase.Instance.BroadCastEvent(eventData, peers, sendParameters);
 }
Exemple #3
0
 /// <summary>
 ///   Publishes an event to a list of actors on a specified channel.
 /// </summary>
 /// <param name = "e">
 ///   The event to publish.
 /// </param>
 /// <param name = "actorList">
 ///   A list of <see cref = "Actor" /> who should receive the event.
 /// </param>
 /// <param name = "sendParameters">
 ///   The send Parameters.
 /// </param>
 protected void PublishEvent(LiteEventBase e, IEnumerable<Actor> actorList, SendParameters sendParameters)
 {
     IEnumerable<PeerBase> peers = actorList.Select(actor => actor.Peer);
     var eventData = new EventData(e.Code, e);
     eventData.SendTo(peers, sendParameters);
 }