This class wraps an Action with the ErrorHandlerUtils.HandleExceptions(Action) method to correclty handle all exceptions that escape the action.
Пример #1
0
 /// <summary>
 /// Initializes a new instance of ProtectedCommand.
 /// </summary>
 /// <param name="handler">The action to execute when the command is executed.</param>
 /// <param name="canExecuteCommand">Whether the command is enabled or not.</param>
 public ProtectedCommand(Action handler, bool canExecuteCommand = true)
 {
     _action = new ProtectedAction(handler);
     this.CanExecuteCommand = canExecuteCommand;
 }
 /// <summary>
 /// Initializes a new instance of ProtectedCommand.
 /// </summary>
 /// <param name="handler">The action to execute when the command is executed.</param>
 /// <param name="canExecuteCommand">Whether the command is enabled or not.</param>
 public ProtectedCommand(Action handler, bool canExecuteCommand = true)
 {
     _action = new ProtectedAction(handler);
     this.CanExecuteCommand = canExecuteCommand;
 }