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