Beispiel #1
0
 private void Init_DropBoxController()
 {
     log.Info("Initializing Dropbox Controller...");
     this.dropBoxController = new DropBoxController();
     if (!this.dropBoxController.Login())
     {
         // TODO: WTF
         Process.GetCurrentProcess().Kill();
     }
 }
Beispiel #2
0
        public ShareTaskWorker(DropBoxController dropboxController, ProxyServerController proxyServerController)
        {
            this.DropboxController     = dropboxController;
            this.ProxyServerController = proxyServerController;

            this.ShareWorker                            = new BackgroundWorker();
            this.ShareWorker.DoWork                    += new DoWorkEventHandler(ShareWorker_DoWork);
            this.ShareWorker.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(ShareWorker_RunWorkerCompleted);
            this.ShareWorker.WorkerReportsProgress      = true;
            this.ShareWorker.WorkerSupportsCancellation = true;
        }
        public void EventDelete(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to delete this backup ? ", "Delete backup", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);

            if (DialogResult.Yes == result)
            {
                if (selectedItem != null)
                {
                    Backup backup = databaseService.GetBackup((int)selectedItem.Tag);
                    Cloud  cloud  = databaseService.GetCloud(backup.cloudId);
                    ICloud cloudController;
                    if (cloud.cloudType.Equals("dropbox"))
                    {
                        cloudController = new DropBoxController();
                    }
                    else
                    {
                        cloudController = new OneDriveController();
                    }
                    cloudController.DeleteFolder(cloud.token, DeleteFolderCompelte, backup.targetPath);
                    databaseService.DeleteBackup(backup.id);
                }
            }
        }
        private void submitBtn_Click(object sender, EventArgs e)
        {
            DropBoxController.syncAcc(false);

            DropBoxController.filesync();
        }