c# - How ways to return to "void" kind? -


i'm using on windows phone 8.1

try {     var url = "https://...../oauth/authorize?client_id=" + uri.escapedatastring("4a3e...") + "&response_type=code&redirect_uri=" + uri.escapedatastring("http://localhost:8888/callback") + "&show_dialog=true";     var starturi = new uri(url);     var enduri = new uri("http://localhost:8888/callback");      webauthenticationbroker.authenticateandcontinue(starturi, enduri,null, webauthenticationoptions.none); } catch (exception error) {     //     // bad parameter, ssl/tls errors , network unavailable errors handled here.     //     var dialog = new messagedialog(error.message);     await dialog.showasync(); } 

because webauthenticationbroker.authenticateandcontinue void kind cant put var t=webauthenticationbroker.authenticateandcontinue on

i want return below code

public async void continuewebauthentication(webauthenticationbrokercontinuationeventargs args) {     webauthenticationresult result = args.webauthenticationresult;      if (result.responsestatus == webauthenticationstatus.success)     {         //outputtoken(result.responsedata.tostring());         await getusernameasync(result.responsedata.tostring());     }     else if (result.responsestatus == webauthenticationstatus.errorhttp)     {         throw new exception("http error returned authenticateasync() : " + result.responseerrordetail.tostring());     }     else     {         throw new exception("error returned authenticateasync() : " + result.responseerrordetail.tostring());     } } 

void not "type" means method has no returned value. not need return statement.


Comments

Popular posts from this blog

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

javascript - Create websocket without connecting -

android - Linear layout children not scrolling -