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); }
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; } }
private void ClearProperties() { _cloud = new Dropbox(); _currentUser = null; groupsListBox.DataSource = null; usersListBox.DataSource = null; filesListBox.DataSource = null; }