Exemple #1
0
 void BootstrapDropbox()
 {
     // Setup Dropbox.
     Account = DBAccountManager.GetInstance(ApplicationContext, DropboxSyncKey, DropboxSyncSecret);
     Account.LinkedAccountChanged += (sender, e) => {
         if (e.P1.IsLinked)
         {
             Log("Account.LinkedAccountChanged", "Now linked to {0}", e.P1 != null ? e.P1.AccountInfo != null ? e.P1.AccountInfo.DisplayName : "nobody" : "null");
         }
         else
         {
             Log("Account.LinkedAccountChanged", "Now unlinked from {0}", e.P1 != null ? e.P1.AccountInfo != null ? e.P1.AccountInfo.DisplayName : "nobody" : "null");
             Account.StartLink(this, (int)RequestCode.LinkToDropboxRequest);
             return;
         }
         Account = e.P0;
         StartApp(e.P1);
     };
     // TODO: Restart auth flow.
     if (!Account.HasLinkedAccount)
     {
         Account.StartLink(this, (int)RequestCode.LinkToDropboxRequest);
     }
     else
     {
         StartApp();
     }
 }
Exemple #2
0
        DBDatastore DropboxDatastore;      //VARAIBLE DE ADMINISTRACION DE NUESTRA DATASTORE



        //INICIA LA CONEXION CON NUESTRA CUENTA DE DROPBOX
        void IniciaConexionCuentaDropBox()
        {
            // INICIALIZAMOS NUESTRA VARIABLE ACCOUNT PASANDOLE LAS LLAVES QUE SE CREARON AL MOMENTO DE CREAR NUESTRA
            // APP EN EL PANEL DE DROPBOX CONSOLE
            Account = DBAccountManager.GetInstance(ApplicationContext, DropboxSyncKey, DropboxSyncSecret);

            //VERIFICAMOS SI LA CUENTA ESTA EN LINEA
            if (!Account.HasLinkedAccount)
            {
                //SI NO ESTA EN LINEA LLAMAMOS LA ACTIVIDAD DE INICIO DE SESION DE DROPBOX
                Account.StartLink(this, (int)RequestCode.LinkToDropboxRequest);
            }
        }
Exemple #3
0
        public void Init(string appKey, string appSecret)
        {
            _dropboxSyncKey    = appKey;
            _dropboxSyncSecret = appSecret;
            var activity = Helper.GetCurrentActivity();

            Account = DBAccountManager.GetInstance(activity.ApplicationContext, _dropboxSyncKey, _dropboxSyncSecret);
            Account.LinkedAccountChanged -= LinkedAccountChanged;
            Account.LinkedAccountChanged += LinkedAccountChanged;
            // TODO: Restart auth flow.
            if (!Account.HasLinkedAccount)
            {
                Account.StartLink(activity, (int)RequestCode.LinkToDropboxRequest);
            }
            else
            {
                StartApp();
            }
        }