Exemple #1
0
    public void MathCallback(IAsyncResult iar)
    {
        MathFunctionToCall mc     = (MathFunctionToCall)iar.AsyncState;
        double             result = mc.EndInvoke(iar);

        Console.WriteLine("Function value = {0}", result);
    }
Exemple #2
0
    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();
    }