private SafeCall ( System.Action action, Action |
||
action | System.Action | |
exceptionHandler | Action |
|
Résultat | void |
private void SafeCall(Action action, Action<Exception> exceptionHandler)
{
try
{
action();
}
catch (Exception ex)
{
if (this.InvokeRequired) this.Invoke(exceptionHandler, ex);
else exceptionHandler(ex);
}
}