2013-09-11 06:33:47 +00:00
|
|
|
using System;
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
2013-05-08 05:47:15 +00:00
|
|
|
|
2013-09-11 06:33:47 +00:00
|
|
|
namespace NzbDrone.Core.Messaging
|
2013-05-08 05:47:15 +00:00
|
|
|
{
|
|
|
|
public static class MessageExtensions
|
|
|
|
{
|
|
|
|
public static string GetExecutorName(this Type commandType)
|
|
|
|
{
|
2013-09-11 06:33:47 +00:00
|
|
|
if (!typeof(Command).IsAssignableFrom(commandType))
|
2013-05-08 05:47:15 +00:00
|
|
|
{
|
2013-05-09 06:38:20 +00:00
|
|
|
throw new ArgumentException("commandType must implement ICommand");
|
2013-05-08 05:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return string.Format("I{0}Executor", commandType.Name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|