public void AddSyncAccount(DropboxSyncAccount syncAccount)
        {
            RemoveSyncAccount(syncAccount.Id);

            Configuration.SyncAccounts.Add(syncAccount);

            Plugin.Instance.SaveConfiguration();
        }
Esempio n. 2
0
        public void AddSyncAccount(DropboxSyncAccount syncAccount)
        {
            RemoveSyncAccount(syncAccount.Id);

            Configuration.SyncAccounts.Add(syncAccount);

            Plugin.Instance.SaveConfiguration();
        }
        public async Task Post(AddSyncTarget request)
        {
            var accessToken = await GetAccessToken(request.Code);

            var syncAccount = new DropboxSyncAccount
            {
                Id = Guid.NewGuid().ToString(),
                Name = WebUtility.UrlDecode(request.Name),
                EnableForEveryone = request.EnableForEveryone,
                UserIds = request.UserIds,
                AccessToken = accessToken
            };

            if (!string.IsNullOrEmpty(request.Id))
            {
                syncAccount.Id = request.Id;
            }

            _configurationRetriever.AddSyncAccount(syncAccount);
        }
 private SyncTarget CreateSyncTarget(DropboxSyncAccount syncAccount)
 {
     return new SyncTarget
     {
         Id = syncAccount.Id,
         Name = syncAccount.Name
     };
 }