// ReSharper disable once UnusedMember.Local void WebBrowserNavigated(object sender, NavigationEventArgs e) { var token = _client.GetAccessToken(); Key = token.Token; Secret = token.Secret; }
public static Func<NancyContext, Response> RequiresDropboxAuthentication(IDropNetClient dropNetClient) { return (ctx) => { Response response = null; try { var token = dropNetClient.GetAccessToken(); dropNetClient.UserLogin = token; } catch (DropboxRestException ex) when (ex.StatusCode.Equals(System.Net.HttpStatusCode.BadRequest)) { response = new Response { StatusCode = HttpStatusCode.Unauthorized }; } catch (DropboxRestException ex) when (ex.StatusCode.Equals(System.Net.HttpStatusCode.Unauthorized)) { // } return response; }; }
public static Func <NancyContext, Response> RequiresDropboxAuthentication(IDropNetClient dropNetClient) { return((ctx) => { Response response = null; try { var token = dropNetClient.GetAccessToken(); dropNetClient.UserLogin = token; } catch (DropboxRestException ex) when(ex.StatusCode.Equals(System.Net.HttpStatusCode.BadRequest)) { response = new Response { StatusCode = HttpStatusCode.Unauthorized }; } catch (DropboxRestException ex) when(ex.StatusCode.Equals(System.Net.HttpStatusCode.Unauthorized)) { // } return response; }); }