mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
fixed service registration for event handlers and executors.
This commit is contained in:
parent
399c96c5e3
commit
fa8f67d7fe
12 changed files with 190 additions and 95 deletions
17
NzbDrone.Common/Messaging/MessageExtensions.cs
Normal file
17
NzbDrone.Common/Messaging/MessageExtensions.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
|
||||
namespace NzbDrone.Common.Messaging
|
||||
{
|
||||
public static class MessageExtensions
|
||||
{
|
||||
public static string GetExecutorName(this Type commandType)
|
||||
{
|
||||
if (!typeof(ICommand).IsAssignableFrom(commandType))
|
||||
{
|
||||
throw new ArgumentException("commandType must implement IExecute");
|
||||
}
|
||||
|
||||
return string.Format("I{0}Executor", commandType.Name);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue