2021-05-06 22:39:20 +00:00
|
|
|
using System;
|
2020-08-14 00:29:14 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Events
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// An interface that handles eventing.
|
|
|
|
/// </summary>
|
|
|
|
public interface IEventManager
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Publishes an event.
|
|
|
|
/// </summary>
|
2020-08-15 19:55:15 +00:00
|
|
|
/// <param name="eventArgs">the event arguments.</param>
|
|
|
|
/// <typeparam name="T">The type of event.</typeparam>
|
|
|
|
void Publish<T>(T eventArgs)
|
|
|
|
where T : EventArgs;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Publishes an event asynchronously.
|
|
|
|
/// </summary>
|
2020-08-14 00:29:14 +00:00
|
|
|
/// <param name="eventArgs">The event arguments.</param>
|
|
|
|
/// <typeparam name="T">The type of event.</typeparam>
|
|
|
|
/// <returns>A task representing the publishing of the event.</returns>
|
2020-08-15 19:55:15 +00:00
|
|
|
Task PublishAsync<T>(T eventArgs)
|
2020-08-14 00:29:14 +00:00
|
|
|
where T : EventArgs;
|
|
|
|
}
|
|
|
|
}
|