Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/30/12 17:39:27 (13 years ago)
Author:
spimming
Message:

#1680:

  • ChangeInstanceCount method added
  • Deployment: added properties to indicate modification and the new instance count
  • Textbox validation
  • Form resized
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

    r7424 r7429  
    7474      this.cmbChooseSubscription.Location = new System.Drawing.Point(15, 25);
    7575      this.cmbChooseSubscription.Name = "cmbChooseSubscription";
    76       this.cmbChooseSubscription.Size = new System.Drawing.Size(471, 21);
     76      this.cmbChooseSubscription.Size = new System.Drawing.Size(486, 21);
    7777      this.cmbChooseSubscription.TabIndex = 2;
    7878      this.cmbChooseSubscription.SelectedValueChanged += new System.EventHandler(this.cmbChooseSubscription_SelectedValueChanged);
     
    9292      this.cmbChooseHostedService.Location = new System.Drawing.Point(15, 65);
    9393      this.cmbChooseHostedService.Name = "cmbChooseHostedService";
    94       this.cmbChooseHostedService.Size = new System.Drawing.Size(471, 21);
     94      this.cmbChooseHostedService.Size = new System.Drawing.Size(486, 21);
    9595      this.cmbChooseHostedService.TabIndex = 6;
    9696      //
     
    109109      this.gbNewHostedService.Location = new System.Drawing.Point(15, 115);
    110110      this.gbNewHostedService.Name = "gbNewHostedService";
    111       this.gbNewHostedService.Size = new System.Drawing.Size(469, 145);
     111      this.gbNewHostedService.Size = new System.Drawing.Size(486, 145);
    112112      this.gbNewHostedService.TabIndex = 7;
    113113      this.gbNewHostedService.TabStop = false;
     
    277277      this.tbInstanceCount.Location = new System.Drawing.Point(13, 378);
    278278      this.tbInstanceCount.Name = "tbInstanceCount";
    279       this.tbInstanceCount.Size = new System.Drawing.Size(469, 20);
     279      this.tbInstanceCount.Size = new System.Drawing.Size(488, 20);
    280280      this.tbInstanceCount.TabIndex = 13;
     281      this.tbInstanceCount.Validating += new System.ComponentModel.CancelEventHandler(this.tbInstanceCount_Validating);
    281282      //
    282283      // lblCores
    283284      //
    284285      this.lblCores.AutoSize = true;
    285       this.lblCores.Location = new System.Drawing.Point(452, 361);
     286      this.lblCores.Location = new System.Drawing.Point(471, 361);
    286287      this.lblCores.Name = "lblCores";
    287288      this.lblCores.Size = new System.Drawing.Size(30, 13);
     
    292293      //
    293294      this.label10.AutoSize = true;
    294       this.label10.Location = new System.Drawing.Point(417, 361);
     295      this.label10.Location = new System.Drawing.Point(436, 361);
    295296      this.label10.Name = "label10";
    296297      this.label10.Size = new System.Drawing.Size(40, 13);
     
    303304      this.progressBar.MarqueeAnimationSpeed = 10;
    304305      this.progressBar.Name = "progressBar";
    305       this.progressBar.Size = new System.Drawing.Size(307, 23);
     306      this.progressBar.Size = new System.Drawing.Size(326, 23);
    306307      this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
    307308      this.progressBar.TabIndex = 16;
     
    309310      // btnOk
    310311      //
    311       this.btnOk.Location = new System.Drawing.Point(326, 404);
     312      this.btnOk.Location = new System.Drawing.Point(345, 404);
    312313      this.btnOk.Name = "btnOk";
    313314      this.btnOk.Size = new System.Drawing.Size(75, 23);
     
    319320      // btnCancel
    320321      //
    321       this.btnCancel.Location = new System.Drawing.Point(407, 404);
     322      this.btnCancel.Location = new System.Drawing.Point(426, 404);
    322323      this.btnCancel.Name = "btnCancel";
    323324      this.btnCancel.Size = new System.Drawing.Size(75, 23);
     
    344345      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    345346      this.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange;
    346       this.ClientSize = new System.Drawing.Size(496, 436);
     347      this.ClientSize = new System.Drawing.Size(517, 436);
    347348      this.Controls.Add(this.lblCertificateFile);
    348349      this.Controls.Add(this.lblCores);
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddAzureServiceDialog.cs

    r7424 r7429  
    306306          e.Cancel = true;
    307307        } else if (!isValidHostedServiceUrl(url)) {
    308           errorProvider.SetError(tbLabel, "A hosted service name must be between 1 and 63 " +
    309                                           "characters long, and be composed of letters, numbers " +
    310                                           "and hyphens. Hyphens shouldn't be first or last letter.");
     308          errorProvider.SetError(tbServiceName, "A hosted service name must be between 1 and 63 " +
     309                                                "characters long, and be composed of letters, numbers " +
     310                                                "and hyphens. Hyphens shouldn't be first or last letter.");
    311311          e.Cancel = true;
    312312        } else {
     
    336336      }
    337337    }
     338
     339    private void tbInstanceCount_Validating(object sender, CancelEventArgs e) {
     340      if (!isValidInstanceCount(tbInstanceCount.Text)) {
     341        errorProvider.SetError(tbInstanceCount, "Instance count must be a number greater than 0 and " +
     342                                                 "less or equal than the difference between maximum and available cores.");
     343        e.Cancel = true;
     344      } else {
     345        int instanceCount = Convert.ToInt32(tbInstanceCount.Text);
     346        Subscription subscription = (Subscription)cmbChooseSubscription.SelectedItem;
     347        if (instanceCount > subscription.MaxCoreCount - subscription.CurrentCoreCount) {
     348          errorProvider.SetError(tbInstanceCount, "Instance count must be less or equal than the difference between maximum and available cores.");
     349        } else {
     350          e.Cancel = true;
     351          errorProvider.SetError(tbInstanceCount, "");
     352        }
     353      }
     354    }
     355
     356    private bool isValidInstanceCount(string text) {
     357      string regexString = @"[1-9]+[0-9-]*";  //TODO
     358      Regex regex = new Regex(regexString);
     359      if (regex.IsMatch(text)) {
     360        return true;
     361      } else {
     362        return false;
     363      }
     364    }
    338365  }
    339366}
Note: See TracChangeset for help on using the changeset viewer.