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