public DropboxConnection(UserLogin userLogin)
 {
     _dropboxClient = DropboxUserPermission.GetAuthenticatedClient(userLogin);
 }
예제 #2
0
 private void InitializeDropboxSettings(IExternalBrowserService externalBrowserService, ApplicationEvents applicationEvents)
 {
     _dropboxSwitch = new SwitchCell
     {
         Text = "Use Dropbox",
         On = PersistedState.UserLogin != null && !string.IsNullOrEmpty(PersistedState.UserLogin.Secret)
     };
     _dropboxSwitch.OnChanged += (sender, args) =>
     {
         if (args.Value)
         {
             applicationEvents.Resumed += ApplicationEventsOnResumed;
             _dropboxUserPermission = new DropboxUserPermission();
             _dropboxUserPermission.AskUserForPermission(externalBrowserService);
             //(continue in ApplicationEventsOnResumed())
         }
         else
         {
             PersistedState.UserLogin = null;
         }
         SyncBootstrapper.RefreshDropboxSync(_fileRepository);
     };
 }