Esempio n. 1
0
        private void btnOpenDialogManualDownload_Click(object sender, EventArgs e)
        {
            using (DropboxDialogBase dlg = new OpenDropboxDialog(OpenDialogType.File))
            {
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    txtDownloadSource.Text = dlg.SelectedFile;

                    MessageBox.Show(this, "File selected for download", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                    // The file can be downloaded using the DownloadSelectedFile function
                    //dlg.DownloadSelectedFile(myLocalFilePath);
                }
            }
        }
Esempio n. 2
0
        private void btnOpenDialogAutoDownload_Click(object sender, EventArgs e)
        {
            if (Directory.Exists(txtDownloadFolder.Text))
            {
                using (DropboxDialogBase dlg = new OpenDropboxDialog(OpenDialogType.File))
                {
                    dlg.DownloadFolder = txtDownloadFolder.Text;
                    //dlg.Filter = "Word Documents (*.docx)|*.docx|All Files (*.*)|*.*";
                    //dlg.Filter = "Office Documents (*.docx, *.xlsx)|*.docx; *.xlsx|All Files (*.*)|*.*";

                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        MessageBox.Show(this, "File downloaded", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            else
            {
                MessageBox.Show(this, "Directory '" + txtDownloadFolder.Text + "' doesn't exist", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }