Exemplo n.º 1
0
 /* ----------------------------------------------------------------- */
 ///
 /// Post
 ///
 /// <summary>
 /// Posts the specified message.
 /// </summary>
 ///
 /// <param name="message">Message to be posted.</param>
 ///
 /* ----------------------------------------------------------------- */
 protected void Post <T>(T message) => _post.Invoke(() => Aggregator.Publish(message));
Exemplo n.º 2
0
 /* ----------------------------------------------------------------- */
 ///
 /// Subscribe
 ///
 /// <summary>
 /// Subscribes the message of type T.
 /// </summary>
 ///
 /// <typeparam name="T">message type.</typeparam>
 ///
 /// <param name="callback">
 /// Action to be invoked when the message of type T is published.
 /// </param>
 ///
 /// <returns>Object to clear the subscription.</returns>
 ///
 /* ----------------------------------------------------------------- */
 public IDisposable Subscribe <T>(Action <T> callback) => Aggregator.Subscribe(callback);
Exemplo n.º 3
0
 /* ----------------------------------------------------------------- */
 ///
 /// Send
 ///
 /// <summary>
 /// Sends the specified message.
 /// </summary>
 ///
 /// <param name="message">Message to be sent.</param>
 ///
 /* ----------------------------------------------------------------- */
 protected void Send <T>(T message) => _send.Invoke(() => Aggregator.Publish(message));
Exemplo n.º 4
0
 /* ----------------------------------------------------------------- */
 ///
 /// PresentableBase
 ///
 /// <summary>
 /// Initializes a new instance of the PresentableBase class with
 /// the specified arguments.
 /// </summary>
 ///
 /// <param name="aggregator">Message aggregator.</param>
 ///
 /* ----------------------------------------------------------------- */
 protected PresentableBase(Aggregator aggregator) :
     this(aggregator, SynchronizationContext.Current)
 {
 }