Esempio n. 1
0
        private void HandleExportToCloudBerryExplorerClicked(object sender, EventArgs e)
        {
            try
            {
                MessageBox.Show(this, "In order to export storage accounts to CloudBerry Explorer, we'll need to load a library for this application. Please select the indicated library in the CloudBerry Explorer installation directory. For example in: c:\\Program Files (x86)\\CloudBerryLab\\CloudBerry Explorer for Azure Blob Storage\\");

                var dialog = new OpenFileDialog();
                if (Directory.Exists(@"c:\Program Files (x86)\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\"))
                {
                    dialog.InitialDirectory = @"c:\Program Files (x86)\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\";
                }
                if (Directory.Exists(@"c:\Program Files\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\"))
                {
                    dialog.InitialDirectory = @"c:\Program Files\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\";
                }
                dialog.CheckFileExists = true;
                dialog.Filter          = "CloudBerryLab Client DLL|CloudBerryLab.Client.dll|All DLLs|*.dll";
                dialog.Multiselect     = false;
                dialog.ReadOnlyChecked = true;
                var result = dialog.ShowDialog(this);
                if (result == DialogResult.Cancel)
                {
                    return;
                }

                var adapter = new CloudberryExplorerAdapter(dialog.FileName);
                int count   = adapter.Export();
                MessageBox.Show(this, "Successfully exported " + count + " (new) accounts to CloudBerry Explorer.");
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Failed to export accounts: " + ex.ToString(), "Export failed!");
            }
        }
Esempio n. 2
0
        private void HandleExportToCloudBerryExplorerClicked(object sender, EventArgs e)
        {
            try
            {
                MessageBox.Show(this,
                                "~~ READ CAREFULLY ~~\r\n" +
                                "\r\n" +
                                "1) Close the CloudBerry Storage application.\r\n" +
                                "\r\n" +
                                "2) Select the Cloud.Client.dll from the CloudBerry Explorer installation directory in the next dialog.\r\n" +
                                "\r\n" +
                                "(In order to export storage accounts to CloudBerry Explorer, we'll need to load a library for this application to deal with their encryption.)");

                var dialog = new OpenFileDialog();
                if (Directory.Exists(@"c:\Program Files (x86)\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\"))
                {
                    dialog.InitialDirectory = @"c:\Program Files (x86)\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\";
                }
                if (Directory.Exists(@"c:\Program Files\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\"))
                {
                    dialog.InitialDirectory = @"c:\Program Files\CloudBerryLab\CloudBerry Explorer for Azure Blob Storage\";
                }
                dialog.CheckFileExists = true;
                dialog.Filter          = "CloudBerryLab Client DLL|Cloud.Client.dll|All DLLs|*.dll";
                dialog.Multiselect     = false;
                dialog.ReadOnlyChecked = true;
                var result = dialog.ShowDialog(this);
                if (result == DialogResult.Cancel)
                {
                    return;
                }

                var adapter = new CloudberryExplorerAdapter(dialog.FileName);
                int count   = adapter.Export();
                MessageBox.Show(this, "Successfully exported " + count + " (new) accounts to CloudBerry Explorer.");
            }
            catch (Exception ex)
            {
                new ReportBugForm(ex).ShowDialog();
            }
        }