Exemplo n.º 1
0
        /* ----------------  Form Event Handlers ---------------------------- */


        private void ThreeSharpFormSample_Load(object sender, EventArgs e)
        {
            try
            {
                if (Properties.Settings.Default.AwsAccessKeyID.Length == 0 || Properties.Settings.Default.AwsSecretAccessKey.Length == 0)
                {
                    SettingsForm settingsForm = new SettingsForm();
                    if (settingsForm.ShowDialog() == DialogResult.OK)
                    {
                        this.config.AwsAccessKeyID = Properties.Settings.Default.AwsAccessKeyID;
                        this.config.AwsSecretAccessKey = Properties.Settings.Default.AwsSecretAccessKey;
                    }
                }

                BindBucketNames();

                if (Properties.Settings.Default.BucketName.Length > 0 && this.comboBoxBucketNames.Items.Contains(Properties.Settings.Default.BucketName))
                {
                    this.comboBoxBucketNames.SelectedItem = Properties.Settings.Default.BucketName;
                }

                ListFolder(this.basePath);

                statsThread = new Thread(new ThreadStart(this.StatsThreadMethod));
                statsThread.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.Close();
            }
        }
Exemplo n.º 2
0
 private void aWSAccessSettingsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         SettingsForm settingsForm = new SettingsForm();
         if (settingsForm.ShowDialog() == DialogResult.OK)
         {
             this.config.AwsAccessKeyID = Properties.Settings.Default.AwsAccessKeyID;
             this.config.AwsSecretAccessKey = Properties.Settings.Default.AwsSecretAccessKey;
         }
         BindBucketNames();
         if (Properties.Settings.Default.BucketName.Length > 0 && this.comboBoxBucketNames.Items.Contains(Properties.Settings.Default.BucketName))
         {
             this.comboBoxBucketNames.SelectedItem = Properties.Settings.Default.BucketName;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }