IRecipient{TMessage}.cs 729 B

12345678910111213141516171819
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace CommunityToolkit.Mvvm.Messaging;
  5. /// <summary>
  6. /// An interface for a recipient that declares a registration for a specific message type.
  7. /// </summary>
  8. /// <typeparam name="TMessage">The type of message to receive.</typeparam>
  9. public interface IRecipient<in TMessage>
  10. where TMessage : class
  11. {
  12. /// <summary>
  13. /// Receives a given <typeparamref name="TMessage"/> message instance.
  14. /// </summary>
  15. /// <param name="message">The message being received.</param>
  16. void Receive(TMessage message);
  17. }