|
|
@ -60,7 +60,6 @@ namespace NzbDrone.Common.Messaging
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static string GetEventName(Type eventType)
|
|
|
|
private static string GetEventName(Type eventType)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!eventType.IsGenericType)
|
|
|
|
if (!eventType.IsGenericType)
|
|
|
@ -71,7 +70,6 @@ namespace NzbDrone.Common.Messaging
|
|
|
|
return string.Format("{0}<{1}>", eventType.Name.Remove(eventType.Name.IndexOf('`')), eventType.GetGenericArguments()[0].Name);
|
|
|
|
return string.Format("{0}<{1}>", eventType.Name.Remove(eventType.Name.IndexOf('`')), eventType.GetGenericArguments()[0].Name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void PublishCommand<TCommand>(TCommand command) where TCommand : class, ICommand
|
|
|
|
public void PublishCommand<TCommand>(TCommand command) where TCommand : class, ICommand
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Ensure.That(() => command).IsNotNull();
|
|
|
|
Ensure.That(() => command).IsNotNull();
|
|
|
@ -88,6 +86,7 @@ namespace NzbDrone.Common.Messaging
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
PublishEvent(new CommandStartedEvent(command));
|
|
|
|
handler.Execute(command);
|
|
|
|
handler.Execute(command);
|
|
|
|
sw.Stop();
|
|
|
|
sw.Stop();
|
|
|
|
PublishEvent(new CommandCompletedEvent(command));
|
|
|
|
PublishEvent(new CommandCompletedEvent(command));
|
|
|
|