При асинхронном вызове делегата у вас есть два варианта.
Вариант 1: обратного вызова нет. Я подозреваю, что это то, что вы пытаетесь сделать.
SomeDelegate d;
IAsyncResult res = d.BeginInvoke(null, null);
//..do some other work in the meantime.
try
{
// EndInvoke will wait until execution completes.
// WaitHandle use not needed!
d.EndInvoke(res);
}
catch(Exception ex)
{
//
}
Вариант 2: обратный вызов.
SomeDelegate d;
d.BeginInvoke(res =>
{
// this is called once the delegate completes execution.
try
{
d.EndInvoke(res);
}
catch(Exception ex)
{
//
}
}, null);
//..do some other work in the meantime.
// everything pertaining to the delegate's completion is done in the callback.
// no exception handling should be done here.
Обе формы верны - какая из них вы используете, зависит от того, что вы делаете. Как правило, они не объединяются, как вы.