DefaultCommandHandler.cs 401 B

123456789101112131415161718
  1. namespace Blue
  2. {
  3. /// <summary>
  4. /// 默认Command 处理类
  5. /// </summary>
  6. public class DefaultCommandHandler : ICommandHandler
  7. {
  8. public void ExcuteCommand(ICommand command)
  9. {
  10. command.OnExcute();
  11. }
  12. public void ExcuteCommand<T>() where T : ICommand, new()
  13. {
  14. ExcuteCommand(new T());
  15. }
  16. }
  17. }