View Full Version : Asynchronous calls and events
segiles
01-04-2007, 05:45 AM
Can you supply a sample application which uses asynchronous calls (i.e. VerifyKeyAsync) and events (i.e. VerifyKeyCompleted)?</o:p>
</o:p>
Thanks</o:p>
wisemx
01-04-2007, 07:23 AM
Try this Google ASP.NET CoOp, pulled up a bunch of examples:
http://www.google.com/custom?hl=en&lr=&client=google-coop&cof=CX%3AGoogle%2520Wise%3B&q=asp.net+asynchr onous+calls&cx=009244845836111659857%3Albvxsjj8mho
segiles
01-04-2007, 07:46 AM
Finally figured out how to make the events fire.
</o:p>
1. Declare the api.
</o:p>
public wrDiscountaspi.CustomerApi customerApi = new wrDiscountaspi.CustomerApi();</o:p>
</o:p>
2. </o:p>Create an event handler routine.</o:p>
</o:p>
public void myVerifyKeyCompleted(object sender, wrDiscountaspi.VerifyKeyCompletedEventArgs e)</o:p>
{</o:p>
bool bResult = e.Result;</o:p>
bool bCancelled = e.Cancelled;</o:p>
</o:p>
// do something</o:p>
}
</o:p>
3. Register for the event
</o:p>
this.customerApi.VerifyKeyCompleted += new DiscountASPNet.wrDiscountaspi.VerifyKeyCompletedEv entHandler(myVerifyKeyCompleted);</o:p>
</o:p></o:p>
4. Make the asynchronous call to validate the key.
</o:p>
customerApi.VerifyKeyAsync(sKey);
</o:p>
vBulletin® ©Jelsoft Enterprises Ltd.