Class CommandHandler
This class supports the EPiServer infrastructure and is not intended to be used directly from your code.
Inheritance
Namespace: EPiServer.Util
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class CommandHandler : Object
Constructors
CommandHandler()
Declaration
public CommandHandler()
Methods
RetryExecuteIfException(Action, Type, Int32, TimeSpan)
Tries to execute commad or action. Throw exception if the exception does not exist in the handledexptiontypes list or it occurs more than numberOfRetry.
Declaration
public static void RetryExecuteIfException(Action command, Type handledExceptionType, int numberOfRetry, TimeSpan waitFor)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action | command | The command. |
| System.Type | handledExceptionType | The handled exception type. |
| System.Int32 | numberOfRetry | number of try. |
| System.TimeSpan | waitFor | The amount of time that we wait for the next call. |
TryExecute(Action, out String)
Tries to execute commad or action.
Declaration
public static bool TryExecute(Action command, out string errorMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action | command | The command or action. |
| System.String | errorMessage | The error message. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the command executes without exception otherwise false |
TryExecute(Action, out String, Type[])
Tries to execute commad or action. Throw exception if an exception occurs during execution and the exception does not exist in the handledexptiontypes list.
Declaration
public static bool TryExecute(Action command, out string errorMessage, params Type[] handledExceptionTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action | command | The command. |
| System.String | errorMessage | The error message. |
| System.Type[] | handledExceptionTypes | The handled exception types. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the command executes without exception otherwise false |