Asynchronous calls and events

Discussion in 'Control Panel API' started by segiles, Jan 4, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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>
     
  2. 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.VerifyKeyCompletedEventHandler(myVerifyKeyCompleted);</o:p>
    </o:p></o:p>
    4. Make the asynchronous call to validate the key.
    </o:p>
    customerApi.VerifyKeyAsync(sKey);
    </o:p>
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page