post grab notification and updates are now using the new EventAggregator
This commit is contained in:
@@ -17,7 +17,7 @@ namespace NzbDrone.Common.Eventing
|
||||
_handlers = handlers;
|
||||
}
|
||||
|
||||
public void Publish<TEvent>(TEvent message)
|
||||
public void Publish<TEvent>(TEvent message) where TEvent : IEvent
|
||||
{
|
||||
_logger.Trace("Publishing {0}", message.GetType().Name);
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Common.Eventing
|
||||
{
|
||||
public interface IEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,6 @@ namespace NzbDrone.Common.Eventing
|
||||
/// </summary>
|
||||
public interface IEventAggregator
|
||||
{
|
||||
void Publish<TEvent>(TEvent message);
|
||||
void Publish<TEvent>(TEvent message) where TEvent : IEvent;
|
||||
}
|
||||
}
|
||||
@@ -5,14 +5,14 @@ namespace NzbDrone.Common.Eventing
|
||||
/// <summary>
|
||||
/// Denotes a class which can handle a particular type of message.
|
||||
/// </summary>
|
||||
/// <typeparam name = "TMessage">The type of message to handle.</typeparam>
|
||||
public interface IHandle<TMessage> : IHandle
|
||||
/// <typeparam name = "TEvent">The type of message to handle.</typeparam>
|
||||
public interface IHandle<TEvent> : IHandle where TEvent : IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles the message.
|
||||
/// </summary>
|
||||
/// <param name = "message">The message.</param>
|
||||
void Handle(TMessage message);
|
||||
void Handle(TEvent message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -111,6 +111,7 @@
|
||||
<Compile Include="EnsureThat\StringExtensions.cs" />
|
||||
<Compile Include="EnsureThat\TypeParam.cs" />
|
||||
<Compile Include="Eventing\EventAggregator.cs" />
|
||||
<Compile Include="Eventing\IEvent.cs" />
|
||||
<Compile Include="Eventing\IEventAggregator.cs" />
|
||||
<Compile Include="Eventing\IHandle.cs" />
|
||||
<Compile Include="HostController.cs" />
|
||||
|
||||
Reference in New Issue
Block a user