public static void ExcuteCommandWithoutDispatcher <T>(this IRegistorCommand <T> command, object param) { try { if (command.CanExecute(param)) { command.Execute(param); } } catch (Exception ex) { LogExtensions.Critical(null, ex); } }
/// <summary> /// Uns the registor. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="command">The command.</param> /// <param name="target">The target.</param> public static void UnRegistor <T>(IRegistorCommand <T> command, object target) { command.UnRegistorCommand(target); }
public static void ExcuteCommand <T>(this IRegistorCommand <T> command, object param) { ExcuteCommandWithoutDispatcher(command, param); }
/// <summary> /// Registors the specified command. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="command">The command.</param> /// <param name="target">The target.</param> /// <param name="executeAction">The execute action.</param> /// <param name="canExecuteFunc">The can execute function.</param> public static void Registor <T>(IRegistorCommand <T> command, object target, Action <T> executeAction, Func <T, bool> canExecuteFunc) { command.RegistorCommand(target, executeAction, canExecuteFunc); }