Exemple #1
0
 private async Task ConnectToGroup(string group)
 {
     _connectedToGroup = true;
     ReloadButtonState();
     _cloud = new Dropbox(group);
     usersListBox.DataSource = await _cloud.GetUsersListAsync(_currentUser);
     filesListBox.DataSource = await _cloud.GetFilesListAsync(_currentUser);
 }
Exemple #2
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            if (!CertificatesProcess.CheckCaCertificate())
            {
                Cursor = Cursors.WaitCursor;
                DisableAll();
                var statusLabel = new ToolStripStatusLabel("Adding server certificate to Windows Certificate Store");
                statusBar.Items.Add(statusLabel);
                try
                {
                    var certificatesStore = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
                    certificatesStore.Open(OpenFlags.ReadWrite);
                    var tempCertificate = Path.GetTempFileName();
                    Dropbox cloud = new Dropbox();
                    await cloud.DownloadFileAsync(tempCertificate, "cert.crt");
                    certificatesStore.Add(new X509Certificate2(tempCertificate));
                    certificatesStore.Close();
                    File.Delete(tempCertificate);
                }
                catch
                {

                }
                EnableIdentity();
                if (_connected)
                    EnableGroups();
                statusBar.Items.Remove(statusLabel);
                Cursor = Cursors.Arrow;
            }
        }
Exemple #3
0
 private void ClearProperties()
 {
     _cloud = new Dropbox();
     _currentUser = null;
     groupsListBox.DataSource = null;
     usersListBox.DataSource = null;
     filesListBox.DataSource = null;
 }