Hi
I call some "worker"-Methods asyncronous. here some simplified code
....
public delegate long AsyncWCaller(st ring parameter);
....
// Setting the Status-Delegate, worker object is given by parameter
Logger log = new Logger();
worker.StatusEv entHandler += new Worker.StatusEv ent( log.LogStatus);
// later on - in workerFinishd i will do
// worker.StatusEv entHandler -= new
Worker.StatusEv ent( log.LogStatus);
// Starting the Job async.
AsyncWCaller asyncW = new
AsyncWCaller(wo rker.DoSomethin gWithNotificati on);
IAsyncResult wAsyncResult =
asyncW.BeginInv oke( "test", new AsyncCallback(W Finished),
asyncW);
-- ok
----
private void WFinished( IAsyncResult ar )
{
AsyncWCaller caller = (AsyncWCaller) ar.AsyncState;
long result = caller.EndInvok e(ar);
// !!!! My Problem is here
// 1. I will do some logging --result
// 2.I will remove the status event
// worker.StatusEv entHandler -= new
Worker.StatusEv ent( log.LogStatus);
//
// so how can i derermine the worker-Object here
}
Thanks Peter