2013-05-08 05:47:15 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Messaging
|
|
|
|
|
{
|
|
|
|
|
public static class MessageExtensions
|
|
|
|
|
{
|
|
|
|
|
public static string GetExecutorName(this Type commandType)
|
|
|
|
|
{
|
|
|
|
|
if (!typeof(ICommand).IsAssignableFrom(commandType))
|
|
|
|
|
{
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|