Commits

HexRx committed 652fd4d

Refactored

  • Participants
  • Parent commits 270da2d

Comments (0)

Files changed (1)

File KPDataSave/Libs/DropboxAPI/DropboxClient.cs

 
         public string Login_GetUrlLink()
         {
-            RestClient client = new RestClient(apiBase);
-            RestRequest request = new RestRequest(Method.POST);
+            var client = new RestClient(apiBase);
+            var request = new RestRequest(Method.POST);
 
             // request_token
             client.Authenticator = OAuth1Authenticator.ForRequestToken(appKey, appSecret);
 
         public AccessToken Login_RequestAccessToken()
         {
-            RestClient client = new RestClient(apiBase);
-            RestRequest request = new RestRequest(Method.POST);
+            var client = new RestClient(apiBase);
+            var request = new RestRequest(Method.POST);
 
             // access_token
             request.Resource = "{version}/oauth/access_token";
         // Получение информации об аккаунте
         public AccountInfo GetAccountInfo()
         {
-            RestClient client = new RestClient(apiBase);
-            RestRequest request = new RestRequest(Method.GET);
+            var client = new RestClient(apiBase);
+            var request = new RestRequest(Method.GET);
 
             client.Authenticator = OAuth1Authenticator.ForProtectedResource(appKey, appSecret, AccessToken.Token, AccessToken.TokenSecret);
             request.Resource = "{version}/account/info";
         // Отправка файла
         public bool UploadFile(string path, FileInfo localFile)
         {
-            RestClient client = new RestClient(apiContent);
-            RestRequest request = new RestRequest(Method.POST);
+            var client = new RestClient(apiContent);
+            var request = new RestRequest(Method.POST);
 
             // Обязательно путь должен начинаться на '/'
             if (!path.StartsWith("/")) path = "/" + path;
         // Получение данных о файлах
         public MetaData GetMetaData(string path)
         {
-            RestClient client = new RestClient(apiBase);
-            RestRequest request = new RestRequest(Method.GET);
+            var client = new RestClient(apiBase);
+            var request = new RestRequest(Method.GET);
 
             client.Authenticator = OAuth1Authenticator.ForProtectedResource(appKey, appSecret, AccessToken.Token, AccessToken.TokenSecret);