Changeset 8048
- Timestamp:
- 06/19/12 11:05:08 (13 years ago)
- 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 46 46 this.btnAddCertificate = new System.Windows.Forms.Button(); 47 47 this.label9 = new System.Windows.Forms.Label(); 48 this.tbInstanceCount = new System.Windows.Forms.TextBox();49 48 this.lblCores = new System.Windows.Forms.Label(); 50 49 this.label10 = new System.Windows.Forms.Label(); … … 54 53 this.lblCertificateFile = new System.Windows.Forms.Label(); 55 54 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(); 56 57 this.gbStorageService = new System.Windows.Forms.GroupBox(); 58 this.label12 = new System.Windows.Forms.Label(); 57 59 this.cbCreateBlobIfNotExists = new System.Windows.Forms.CheckBox(); 58 this.tbBlobContainer = new System.Windows.Forms.TextBox();59 60 this.label11 = new System.Windows.Forms.Label(); 60 this.cmbStorageServices = new System.Windows.Forms.ComboBox();61 61 this.label8 = new System.Windows.Forms.Label(); 62 62 this.rbVMSizeMedium = new System.Windows.Forms.RadioButton(); … … 65 65 this.rbVMSizeExtraLarge = new System.Windows.Forms.RadioButton(); 66 66 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();73 67 this.label15 = new System.Windows.Forms.Label(); 74 68 this.label16 = new System.Windows.Forms.Label(); 75 69 this.label17 = new System.Windows.Forms.Label(); 76 70 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(); 77 77 this.gbNewHostedService.SuspendLayout(); 78 78 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); … … 80 80 this.gbDeploymentOptions.SuspendLayout(); 81 81 this.gbVMSize.SuspendLayout(); 82 ((System.ComponentModel.ISupportInitialize)(this.instancesNumericUpDown)).BeginInit(); 82 83 this.SuspendLayout(); 83 84 // … … 280 281 this.label9.Text = "How many instances should be used?"; 281 282 // 282 // tbInstanceCount283 //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 //291 283 // lblCores 292 284 // … … 339 331 // 340 332 this.lblCertificateFile.AutoSize = true; 341 this.lblCertificateFile.Location = new System.Drawing.Point(120, 605);333 this.lblCertificateFile.Location = new System.Drawing.Point(120, 476); 342 334 this.lblCertificateFile.Name = "lblCertificateFile"; 343 335 this.lblCertificateFile.Size = new System.Drawing.Size(0, 13); … … 348 340 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 349 341 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); 350 361 // 351 362 // gbStorageService … … 364 375 this.gbStorageService.Text = "Set storage service"; 365 376 // 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 // 366 386 // cbCreateBlobIfNotExists 367 387 // … … 375 395 this.cbCreateBlobIfNotExists.UseVisualStyleBackColor = true; 376 396 // 377 // tbBlobContainer378 //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 //386 397 // label11 387 398 // … … 392 403 this.label11.TabIndex = 2; 393 404 this.label11.Text = "Set blob container:"; 394 //395 // cmbStorageServices396 //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);404 405 // 405 406 // label8 … … 453 454 this.rbVMSizeExtraLarge.UseVisualStyleBackColor = true; 454 455 // 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 // 455 496 // gbDeploymentOptions 456 497 // 498 this.gbDeploymentOptions.Controls.Add(this.rbDeployToProduction); 499 this.gbDeploymentOptions.Controls.Add(this.rbDeployToStaging); 457 500 this.gbDeploymentOptions.Controls.Add(this.label14); 458 501 this.gbDeploymentOptions.Controls.Add(this.label13); 459 this.gbDeploymentOptions.Controls.Add(this.rbDeployToProduction);460 this.gbDeploymentOptions.Controls.Add(this.rbDeployToStaging);461 502 this.gbDeploymentOptions.Location = new System.Drawing.Point(15, 302); 462 503 this.gbDeploymentOptions.Name = "gbDeploymentOptions"; … … 465 506 this.gbDeploymentOptions.TabStop = false; 466 507 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:"; 467 526 // 468 527 // gbVMSize … … 492 551 this.label7.Text = "Create new hosted service:"; 493 552 // 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}); 560 569 // 561 570 // AddAzureServiceDialog … … 564 573 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 565 574 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); 567 577 this.Controls.Add(this.label7); 568 578 this.Controls.Add(this.gbVMSize); … … 575 585 this.Controls.Add(this.progressBar); 576 586 this.Controls.Add(this.label10); 577 this.Controls.Add(this.tbInstanceCount);578 587 this.Controls.Add(this.label9); 579 588 this.Controls.Add(this.btnAddCertificate); … … 599 608 this.gbVMSize.ResumeLayout(false); 600 609 this.gbVMSize.PerformLayout(); 610 ((System.ComponentModel.ISupportInitialize)(this.instancesNumericUpDown)).EndInit(); 601 611 this.ResumeLayout(false); 602 612 this.PerformLayout(); … … 626 636 private System.Windows.Forms.Button btnAddCertificate; 627 637 private System.Windows.Forms.Label label9; 628 private System.Windows.Forms.TextBox tbInstanceCount;629 638 private System.Windows.Forms.Label lblCores; 630 639 private System.Windows.Forms.Label label10; … … 655 664 private System.Windows.Forms.Label label14; 656 665 private System.Windows.Forms.Label label13; 666 private System.Windows.Forms.NumericUpDown instancesNumericUpDown; 657 667 } 658 668 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddAzureServiceDialog.cs
r7661 r8048 200 200 string certFile = certificateFile; 201 201 string certPw = certificatePassword; 202 int instanceCount = Convert.ToInt32(tbInstanceCount.Text); 202 //int instanceCount = Convert.ToInt32(tbInstanceCount.Text); 203 int instanceCount = Convert.ToInt32(instancesNumericUpDown.Value); 203 204 204 205 … … 250 251 Subscription item = (Subscription)e.Argument; 251 252 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 }); 253 257 254 258 List<HostedService> services = CloudManagerClient.Instance.AzureProvider.ListHostedServices(item); … … 447 451 } 448 452 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-]*"; //TODO468 Regex regex = new Regex(regexString);469 if (regex.IsMatch(text)) {470 return true;471 } else {472 return false;473 }474 }475 476 453 private void tbBlobContainer_Validating(object sender, CancelEventArgs e) { 477 454 string name = tbBlobContainer.Text.Trim();
Note: See TracChangeset
for help on using the changeset viewer.