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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -