separates classes to files

This commit is contained in:
Shannon
2020-12-23 11:02:50 +11:00
parent 674b61a7f9
commit ce5cdad376
3 changed files with 36 additions and 23 deletions

View File

@@ -22,27 +22,4 @@ namespace Umbraco.Core.Events
Task PublishAsync<TNotification>(TNotification notification, CancellationToken cancellationToken = default)
where TNotification : INotification;
}
/// <summary>
/// A marker interface to represent a notification.
/// </summary>
public interface INotification
{
}
/// <summary>
/// Defines a handler for a notification.
/// </summary>
/// <typeparam name="TNotification">The type of notification being handled.</typeparam>
public interface INotificationHandler<in TNotification>
where TNotification : INotification
{
/// <summary>
/// Handles a notification
/// </summary>
/// <param name="notification">The notification</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task HandleAsync(TNotification notification, CancellationToken cancellationToken);
}
}

View File

@@ -0,0 +1,12 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
namespace Umbraco.Core.Events
{
/// <summary>
/// A marker interface to represent a notification.
/// </summary>
public interface INotification
{
}
}

View File

@@ -0,0 +1,24 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System.Threading;
using System.Threading.Tasks;
namespace Umbraco.Core.Events
{
/// <summary>
/// Defines a handler for a notification.
/// </summary>
/// <typeparam name="TNotification">The type of notification being handled.</typeparam>
public interface INotificationHandler<in TNotification>
where TNotification : INotification
{
/// <summary>
/// Handles a notification
/// </summary>
/// <param name="notification">The notification</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task HandleAsync(TNotification notification, CancellationToken cancellationToken);
}
}