Changeset 7429 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddAzureServiceDialog.cs
- Timestamp:
- 01/30/12 17:39:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddAzureServiceDialog.cs
r7424 r7429 306 306 e.Cancel = true; 307 307 } else if (!isValidHostedServiceUrl(url)) { 308 errorProvider.SetError(tb Label, "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."); 311 311 e.Cancel = true; 312 312 } else { … … 336 336 } 337 337 } 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 } 338 365 } 339 366 }
Note: See TracChangeset
for help on using the changeset viewer.