Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8048


Ignore:
Timestamp:
06/19/12 11:05:08 (12 years ago)
Author:
spimming
Message:

#1680:

  • replaced instanceCount textbox with NumericUpDown control
  • fixed label position
  • removed unnecessary validation code
Location:
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddAzureServiceDialog.Designer.cs

    r7709 r8048  
    4646      this.btnAddCertificate = new System.Windows.Forms.Button();
    4747      this.label9 = new System.Windows.Forms.Label();
    48       this.tbInstanceCount = new System.Windows.Forms.TextBox();
    4948      this.lblCores = new System.Windows.Forms.Label();
    5049      this.label10 = new System.Windows.Forms.Label();
     
    5453      this.lblCertificateFile = new System.Windows.Forms.Label();
    5554      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
     55      this.tbBlobContainer = new System.Windows.Forms.TextBox();
     56      this.cmbStorageServices = new System.Windows.Forms.ComboBox();
    5657      this.gbStorageService = new System.Windows.Forms.GroupBox();
     58      this.label12 = new System.Windows.Forms.Label();
    5759      this.cbCreateBlobIfNotExists = new System.Windows.Forms.CheckBox();
    58       this.tbBlobContainer = new System.Windows.Forms.TextBox();
    5960      this.label11 = new System.Windows.Forms.Label();
    60       this.cmbStorageServices = new System.Windows.Forms.ComboBox();
    6161      this.label8 = new System.Windows.Forms.Label();
    6262      this.rbVMSizeMedium = new System.Windows.Forms.RadioButton();
     
    6565      this.rbVMSizeExtraLarge = new System.Windows.Forms.RadioButton();
    6666      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    67       this.gbDeploymentOptions = new System.Windows.Forms.GroupBox();
    68       this.gbVMSize = new System.Windows.Forms.GroupBox();
    69       this.label7 = new System.Windows.Forms.Label();
    70       this.label12 = new System.Windows.Forms.Label();
    71       this.label13 = new System.Windows.Forms.Label();
    72       this.label14 = new System.Windows.Forms.Label();
    7367      this.label15 = new System.Windows.Forms.Label();
    7468      this.label16 = new System.Windows.Forms.Label();
    7569      this.label17 = new System.Windows.Forms.Label();
    7670      this.label18 = new System.Windows.Forms.Label();
     71      this.gbDeploymentOptions = new System.Windows.Forms.GroupBox();
     72      this.label14 = new System.Windows.Forms.Label();
     73      this.label13 = new System.Windows.Forms.Label();
     74      this.gbVMSize = new System.Windows.Forms.GroupBox();
     75      this.label7 = new System.Windows.Forms.Label();
     76      this.instancesNumericUpDown = new System.Windows.Forms.NumericUpDown();
    7777      this.gbNewHostedService.SuspendLayout();
    7878      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     
    8080      this.gbDeploymentOptions.SuspendLayout();
    8181      this.gbVMSize.SuspendLayout();
     82      ((System.ComponentModel.ISupportInitialize)(this.instancesNumericUpDown)).BeginInit();
    8283      this.SuspendLayout();
    8384      //
     
    280281      this.label9.Text = "How many instances should be used?";
    281282      //
    282       // tbInstanceCount
    283       //
    284       this.errorProvider.SetIconAlignment(this.tbInstanceCount, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    285       this.tbInstanceCount.Location = new System.Drawing.Point(204, 493);
    286       this.tbInstanceCount.Name = "tbInstanceCount";
    287       this.tbInstanceCount.Size = new System.Drawing.Size(230, 20);
    288       this.tbInstanceCount.TabIndex = 12;
    289       this.tbInstanceCount.Validating += new System.ComponentModel.CancelEventHandler(this.tbInstanceCount_Validating);
    290       //
    291283      // lblCores
    292284      //
     
    339331      //
    340332      this.lblCertificateFile.AutoSize = true;
    341       this.lblCertificateFile.Location = new System.Drawing.Point(120, 605);
     333      this.lblCertificateFile.Location = new System.Drawing.Point(120, 476);
    342334      this.lblCertificateFile.Name = "lblCertificateFile";
    343335      this.lblCertificateFile.Size = new System.Drawing.Size(0, 13);
     
    348340      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
    349341      this.errorProvider.ContainerControl = this;
     342      //
     343      // tbBlobContainer
     344      //
     345      this.errorProvider.SetIconAlignment(this.tbBlobContainer, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     346      this.tbBlobContainer.Location = new System.Drawing.Point(184, 40);
     347      this.tbBlobContainer.Name = "tbBlobContainer";
     348      this.tbBlobContainer.Size = new System.Drawing.Size(296, 20);
     349      this.tbBlobContainer.TabIndex = 3;
     350      this.tbBlobContainer.Validating += new System.ComponentModel.CancelEventHandler(this.tbBlobContainer_Validating);
     351      //
     352      // cmbStorageServices
     353      //
     354      this.cmbStorageServices.FormattingEnabled = true;
     355      this.errorProvider.SetIconAlignment(this.cmbStorageServices, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     356      this.cmbStorageServices.Location = new System.Drawing.Point(184, 13);
     357      this.cmbStorageServices.Name = "cmbStorageServices";
     358      this.cmbStorageServices.Size = new System.Drawing.Size(296, 21);
     359      this.cmbStorageServices.TabIndex = 1;
     360      this.cmbStorageServices.Validating += new System.ComponentModel.CancelEventHandler(this.cmbStorageServices_Validating);
    350361      //
    351362      // gbStorageService
     
    364375      this.gbStorageService.Text = "Set storage service";
    365376      //
     377      // label12
     378      //
     379      this.label12.AutoSize = true;
     380      this.label12.Location = new System.Drawing.Point(6, 66);
     381      this.label12.Name = "label12";
     382      this.label12.Size = new System.Drawing.Size(166, 13);
     383      this.label12.TabIndex = 5;
     384      this.label12.Text = "Create blob container if not exists:";
     385      //
    366386      // cbCreateBlobIfNotExists
    367387      //
     
    375395      this.cbCreateBlobIfNotExists.UseVisualStyleBackColor = true;
    376396      //
    377       // tbBlobContainer
    378       //
    379       this.errorProvider.SetIconAlignment(this.tbBlobContainer, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    380       this.tbBlobContainer.Location = new System.Drawing.Point(184, 40);
    381       this.tbBlobContainer.Name = "tbBlobContainer";
    382       this.tbBlobContainer.Size = new System.Drawing.Size(296, 20);
    383       this.tbBlobContainer.TabIndex = 3;
    384       this.tbBlobContainer.Validating += new System.ComponentModel.CancelEventHandler(this.tbBlobContainer_Validating);
    385       //
    386397      // label11
    387398      //
     
    392403      this.label11.TabIndex = 2;
    393404      this.label11.Text = "Set blob container:";
    394       //
    395       // cmbStorageServices
    396       //
    397       this.cmbStorageServices.FormattingEnabled = true;
    398       this.errorProvider.SetIconAlignment(this.cmbStorageServices, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    399       this.cmbStorageServices.Location = new System.Drawing.Point(184, 13);
    400       this.cmbStorageServices.Name = "cmbStorageServices";
    401       this.cmbStorageServices.Size = new System.Drawing.Size(296, 21);
    402       this.cmbStorageServices.TabIndex = 1;
    403       this.cmbStorageServices.Validating += new System.ComponentModel.CancelEventHandler(this.cmbStorageServices_Validating);
    404405      //
    405406      // label8
     
    453454      this.rbVMSizeExtraLarge.UseVisualStyleBackColor = true;
    454455      //
     456      // label15
     457      //
     458      this.label15.AutoSize = true;
     459      this.label15.Location = new System.Drawing.Point(9, 19);
     460      this.label15.Name = "label15";
     461      this.label15.Size = new System.Drawing.Size(32, 13);
     462      this.label15.TabIndex = 4;
     463      this.label15.Text = "Small";
     464      this.toolTip.SetToolTip(this.label15, "1 CPU Core; 1.75 GB Memory; $0.12");
     465      //
     466      // label16
     467      //
     468      this.label16.AutoSize = true;
     469      this.label16.Location = new System.Drawing.Point(9, 38);
     470      this.label16.Name = "label16";
     471      this.label16.Size = new System.Drawing.Size(44, 13);
     472      this.label16.TabIndex = 5;
     473      this.label16.Text = "Medium";
     474      this.toolTip.SetToolTip(this.label16, "1 CPU Core; 1.75 GB Memory; $0.12");
     475      //
     476      // label17
     477      //
     478      this.label17.AutoSize = true;
     479      this.label17.Location = new System.Drawing.Point(9, 57);
     480      this.label17.Name = "label17";
     481      this.label17.Size = new System.Drawing.Size(34, 13);
     482      this.label17.TabIndex = 6;
     483      this.label17.Text = "Large";
     484      this.toolTip.SetToolTip(this.label17, "4 CPU Cores; 7 GB Memory; $0.48");
     485      //
     486      // label18
     487      //
     488      this.label18.AutoSize = true;
     489      this.label18.Location = new System.Drawing.Point(9, 76);
     490      this.label18.Name = "label18";
     491      this.label18.Size = new System.Drawing.Size(61, 13);
     492      this.label18.TabIndex = 7;
     493      this.label18.Text = "Extra Large";
     494      this.toolTip.SetToolTip(this.label18, "8 CPU Cores; 14 GB Memory; $0.96");
     495      //
    455496      // gbDeploymentOptions
    456497      //
     498      this.gbDeploymentOptions.Controls.Add(this.rbDeployToProduction);
     499      this.gbDeploymentOptions.Controls.Add(this.rbDeployToStaging);
    457500      this.gbDeploymentOptions.Controls.Add(this.label14);
    458501      this.gbDeploymentOptions.Controls.Add(this.label13);
    459       this.gbDeploymentOptions.Controls.Add(this.rbDeployToProduction);
    460       this.gbDeploymentOptions.Controls.Add(this.rbDeployToStaging);
    461502      this.gbDeploymentOptions.Location = new System.Drawing.Point(15, 302);
    462503      this.gbDeploymentOptions.Name = "gbDeploymentOptions";
     
    465506      this.gbDeploymentOptions.TabStop = false;
    466507      this.gbDeploymentOptions.Text = "Deployment options";
     508      //
     509      // label14
     510      //
     511      this.label14.AutoSize = true;
     512      this.label14.Location = new System.Drawing.Point(9, 38);
     513      this.label14.Name = "label14";
     514      this.label14.Size = new System.Drawing.Size(174, 13);
     515      this.label14.TabIndex = 3;
     516      this.label14.Text = "Deyploy to production environment:";
     517      //
     518      // label13
     519      //
     520      this.label13.AutoSize = true;
     521      this.label13.Location = new System.Drawing.Point(9, 19);
     522      this.label13.Name = "label13";
     523      this.label13.Size = new System.Drawing.Size(153, 13);
     524      this.label13.TabIndex = 2;
     525      this.label13.Text = "Deploy to staging environment:";
    467526      //
    468527      // gbVMSize
     
    492551      this.label7.Text = "Create new hosted service:";
    493552      //
    494       // label12
    495       //
    496       this.label12.AutoSize = true;
    497       this.label12.Location = new System.Drawing.Point(6, 66);
    498       this.label12.Name = "label12";
    499       this.label12.Size = new System.Drawing.Size(166, 13);
    500       this.label12.TabIndex = 5;
    501       this.label12.Text = "Create blob container if not exists:";
    502       //
    503       // label13
    504       //
    505       this.label13.AutoSize = true;
    506       this.label13.Location = new System.Drawing.Point(9, 19);
    507       this.label13.Name = "label13";
    508       this.label13.Size = new System.Drawing.Size(153, 13);
    509       this.label13.TabIndex = 2;
    510       this.label13.Text = "Deploy to staging environment:";
    511       //
    512       // label14
    513       //
    514       this.label14.AutoSize = true;
    515       this.label14.Location = new System.Drawing.Point(9, 38);
    516       this.label14.Name = "label14";
    517       this.label14.Size = new System.Drawing.Size(174, 13);
    518       this.label14.TabIndex = 3;
    519       this.label14.Text = "Deyploy to production environment:";
    520       //
    521       // label15
    522       //
    523       this.label15.AutoSize = true;
    524       this.label15.Location = new System.Drawing.Point(9, 19);
    525       this.label15.Name = "label15";
    526       this.label15.Size = new System.Drawing.Size(32, 13);
    527       this.label15.TabIndex = 4;
    528       this.label15.Text = "Small";
    529       this.toolTip.SetToolTip(this.label15, "1 CPU Core; 1.75 GB Memory; $0.12");
    530       //
    531       // label16
    532       //
    533       this.label16.AutoSize = true;
    534       this.label16.Location = new System.Drawing.Point(9, 38);
    535       this.label16.Name = "label16";
    536       this.label16.Size = new System.Drawing.Size(44, 13);
    537       this.label16.TabIndex = 5;
    538       this.label16.Text = "Medium";
    539       this.toolTip.SetToolTip(this.label16, "1 CPU Core; 1.75 GB Memory; $0.12");
    540       //
    541       // label17
    542       //
    543       this.label17.AutoSize = true;
    544       this.label17.Location = new System.Drawing.Point(9, 57);
    545       this.label17.Name = "label17";
    546       this.label17.Size = new System.Drawing.Size(34, 13);
    547       this.label17.TabIndex = 6;
    548       this.label17.Text = "Large";
    549       this.toolTip.SetToolTip(this.label17, "4 CPU Cores; 7 GB Memory; $0.48");
    550       //
    551       // label18
    552       //
    553       this.label18.AutoSize = true;
    554       this.label18.Location = new System.Drawing.Point(9, 76);
    555       this.label18.Name = "label18";
    556       this.label18.Size = new System.Drawing.Size(61, 13);
    557       this.label18.TabIndex = 7;
    558       this.label18.Text = "Extra Large";
    559       this.toolTip.SetToolTip(this.label18, "8 CPU Cores; 14 GB Memory; $0.96");
     553      // instancesNumericUpDown
     554      //
     555      this.instancesNumericUpDown.Location = new System.Drawing.Point(204, 494);
     556      this.instancesNumericUpDown.Minimum = new decimal(new int[] {
     557            1,
     558            0,
     559            0,
     560            0});
     561      this.instancesNumericUpDown.Name = "instancesNumericUpDown";
     562      this.instancesNumericUpDown.Size = new System.Drawing.Size(230, 20);
     563      this.instancesNumericUpDown.TabIndex = 18;
     564      this.instancesNumericUpDown.Value = new decimal(new int[] {
     565            1,
     566            0,
     567            0,
     568            0});
    560569      //
    561570      // AddAzureServiceDialog
     
    564573      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    565574      this.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange;
    566       this.ClientSize = new System.Drawing.Size(516, 557);
     575      this.ClientSize = new System.Drawing.Size(516, 552);
     576      this.Controls.Add(this.instancesNumericUpDown);
    567577      this.Controls.Add(this.label7);
    568578      this.Controls.Add(this.gbVMSize);
     
    575585      this.Controls.Add(this.progressBar);
    576586      this.Controls.Add(this.label10);
    577       this.Controls.Add(this.tbInstanceCount);
    578587      this.Controls.Add(this.label9);
    579588      this.Controls.Add(this.btnAddCertificate);
     
    599608      this.gbVMSize.ResumeLayout(false);
    600609      this.gbVMSize.PerformLayout();
     610      ((System.ComponentModel.ISupportInitialize)(this.instancesNumericUpDown)).EndInit();
    601611      this.ResumeLayout(false);
    602612      this.PerformLayout();
     
    626636    private System.Windows.Forms.Button btnAddCertificate;
    627637    private System.Windows.Forms.Label label9;
    628     private System.Windows.Forms.TextBox tbInstanceCount;
    629638    private System.Windows.Forms.Label lblCores;
    630639    private System.Windows.Forms.Label label10;
     
    655664    private System.Windows.Forms.Label label14;
    656665    private System.Windows.Forms.Label label13;
     666    private System.Windows.Forms.NumericUpDown instancesNumericUpDown;
    657667  }
    658668}
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddAzureServiceDialog.cs

    r7661 r8048  
    200200          string certFile = certificateFile;
    201201          string certPw = certificatePassword;
    202           int instanceCount = Convert.ToInt32(tbInstanceCount.Text);
     202          //int instanceCount = Convert.ToInt32(tbInstanceCount.Text);
     203          int instanceCount = Convert.ToInt32(instancesNumericUpDown.Value);
    203204
    204205
     
    250251        Subscription item = (Subscription)e.Argument;
    251252        item = CloudManagerClient.Instance.AzureProvider.GetSubscriptionInfo(item.SubscriptionID, item.CertificateThumbprint);
    252         this.Invoke((MethodInvoker)delegate { lblCores.Text = item.CurrentCoreCount + " / " + item.MaxCoreCount; });
     253        this.Invoke((MethodInvoker)delegate {
     254          lblCores.Text = item.CurrentCoreCount + " / " + item.MaxCoreCount;
     255          instancesNumericUpDown.Maximum = item.MaxCoreCount;
     256        });
    253257
    254258        List<HostedService> services = CloudManagerClient.Instance.AzureProvider.ListHostedServices(item);
     
    447451    }
    448452
    449     private void tbInstanceCount_Validating(object sender, CancelEventArgs e) {
    450       if (!isValidInstanceCount(tbInstanceCount.Text)) {
    451         errorProvider.SetError(tbInstanceCount, "Instance count must be a number greater than 0 and " +
    452                                                  "less or equal than the difference between maximum and available cores.");
    453         e.Cancel = true;
    454       } else {
    455         int instanceCount = Convert.ToInt32(tbInstanceCount.Text);
    456         Subscription subscription = (Subscription)cmbChooseSubscription.SelectedItem;
    457         if (instanceCount > subscription.MaxCoreCount - subscription.CurrentCoreCount) {
    458           errorProvider.SetError(tbInstanceCount, "Instance count must be less or equal than the difference between maximum and available cores.");
    459           e.Cancel = true;
    460         } else {
    461           errorProvider.SetError(tbInstanceCount, "");
    462         }
    463       }
    464     }
    465 
    466     private bool isValidInstanceCount(string text) {
    467       string regexString = @"[1-9]+[0-9-]*";  //TODO
    468       Regex regex = new Regex(regexString);
    469       if (regex.IsMatch(text)) {
    470         return true;
    471       } else {
    472         return false;
    473       }
    474     }
    475 
    476453    private void tbBlobContainer_Validating(object sender, CancelEventArgs e) {
    477454      string name = tbBlobContainer.Text.Trim();
Note: See TracChangeset for help on using the changeset viewer.