void InvokeAsyncCallback(IAsyncResult ar) { InvokeAsyncInfo info = (InvokeAsyncInfo)ar.AsyncState; SimpleWebClientAsyncResult sar = (SimpleWebClientAsyncResult)ar; InvokeCompletedEventArgs args = new InvokeCompletedEventArgs(sar.Exception, false, info.UserState, (object[])sar.Result); if (info.Context != null) { info.Context.Send(info.Callback, args); } else { info.Callback(args); } }
protected void InvokeAsync(string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback, object userState) { InvokeAsyncInfo info = new InvokeAsyncInfo(callback, userState); BeginInvoke(methodName, requestUrl, parameters, new AsyncCallback(InvokeAsyncCallback), info); }
protected void InvokeAsync (string methodName, object[] parameters, SendOrPostCallback callback, object userState) { InvokeAsyncInfo info = new InvokeAsyncInfo (callback, userState); BeginInvoke (methodName, parameters, new AsyncCallback (InvokeAsyncCallback), info); }