Hi,
I'm trying to use AsyncSerialTask with the AddAsyncInvokeServerMethod(). However the declaration of this metod that the Intellisens shows looks like chinees to me. I could not find any DevForce documentation for this nor any samples. The documentation includes one sample for AsyncSerialTask with limited explanation...hard to understand.
Can anyone explain for me how to use AssyncSerialTask.Create().AddAsyncInvokServerMethod()
Here is the serial sequence I'm trying to move to AsyncSerialTask:
private void LoadData(string userID) {
Guid myToken = Guid.NewGuid();
object[] param = {userID};
m_mgr.InvokeServerMethodAsync("C2NetDomainModel.EntCustomer,C2NetDomainModel",
"GetCustomerIDs",
GotCustomerIDs, myToken, userID);
}
public void GotCustomerIDs( InvokeServerMethodEventArgs args )
{
if( args.Error != null )
WriteMessage( args.Error.Message );
else
{
int[] customerIDs = ((C2NetDomainModel.IntIDs)(args.Result)).p_ids;
var customerQ = m_mgr.EntCustomerSet
.OrderBy( c => c.p_name )
.WhereIn( c => c.p_customerID , customerIDs );
m_mgr.ExecuteQueryAsync( (IEntityQuery<EntCustomer>)customerQ, GotCustomers , null );
}
}
private void GotCustomers(EntityFetchedEventArgs args)
{
if (args.Error != null) {
WriteMessage(args.Error.Message);
}
else {
//foreach( EntCustomer c in (System.Linq.IQueryable)args.Result )
foreach( EntCustomer c in (IEnumerable<EntCustomer>)args.Result )
{
_customers.Add(c);
}
// Set CurrentItem to first Customer so form will flesh out
if (_customers.Count > 0) {
_customerDataForm.CurrentItem = _customers[0];
}
ReportFetchCount(args.Result, "Customer");
}
}
Can anyone tell me how to change this to a AsyncSerialTask?