c# - Task.Factory.StartNew not starting? -
i trying go out gateway, data return on ui thread . continuewith runs, gateway never does??
ilogonresult result; task.factory .startnew(() => { result = gateway.authenticate(a, b); }) .continuewith(task => { taskscheduler.fromcurrentsynchronizationcontext(); dosomeui(result); } );
have go @ this, seems wishing execute gateway.authenticate method , return result type method updates ui.
task.factory .startnew(() => { return gateway.authenticate(a, b); }) .continuewith((t) => { if (t.exception == null) { dosomeui(t.result); }else{ //handle exception message } } );
Comments
Post a Comment