public void MathCallback(IAsyncResult iar) { MathFunctionToCall mc = (MathFunctionToCall)iar.AsyncState; double result = mc.EndInvoke(iar); Console.WriteLine("Function value = {0}", result); }
public void MathCallback(IAsyncResult iar) { AsyncCallTracker callTracker = (AsyncCallTracker)iar.AsyncState; MathFunctionToCall func = (MathFunctionToCall)callTracker.Function; double result = func.EndInvoke(iar); Console.WriteLine("Function value = {0}", result); callTracker.DoneEvent.Set(); }