예제 #1
0
        // 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;
            };
        }
예제 #3
0
        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;
            });
        }