Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/07/12 11:16:50 (13 years ago)
Author:
spimming
Message:

#1680:

  • Check if role instance list is not null (while deploying a package)
  • Remove a hosted service when it's deleted
File:
1 edited

Legend:

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

    r7441 r7577  
    3636        txtDeploymentSlot.Text = Content.DeploymentSlot;
    3737        txtDeploymentStatus.Text = Content.Status;
    38         txtInstanceCount.Text = Content.RoleInstanceList.Count.ToString();
    39         if (Content.RoleInstanceList.Count > 0) {
    40           txtInstanceSize.Text = Content.RoleInstanceList[0].InstanceSize;
     38        if (Content.RoleInstanceList != null) {
     39          txtInstanceCount.Text = Content.RoleInstanceList.Count.ToString();
     40          if (Content.RoleInstanceList.Count > 0) {
     41            txtInstanceSize.Text = Content.RoleInstanceList[0].InstanceSize;
     42          }
     43        } else {
     44          txtInstanceCount.Text = "";
     45          txtInstanceSize.Text = "";
    4146        }
     47
    4248
    4349        tbChangeCores.Minimum = 1;
     
    4753          lblChanges.Text = SaveChangesString;
    4854        } else {
    49           tbChangeCores.Value = Content.RoleInstanceList.Count;
     55          if (Content.RoleInstanceList == null) {
     56            tbChangeCores.Value = tbChangeCores.Minimum;
     57          } else {
     58            tbChangeCores.Value = Content.RoleInstanceList.Count;
     59          }
    5060          lblChanges.Text = "";
    5161        }
     
    7585
    7686    private int GetCoresFromInstanceSize(string instanceSize) {
    77       HeuristicLab.Clients.Hive.CloudManager.Azure.Constants.InstanceSize size =
    78        (HeuristicLab.Clients.Hive.CloudManager.Azure.Constants.InstanceSize)Enum.Parse(
    79          typeof(HeuristicLab.Clients.Hive.CloudManager.Azure.Constants.InstanceSize),
    80          instanceSize,
    81          true);
    82       return (int)size;
     87      if (instanceSize != string.Empty) {
     88        HeuristicLab.Clients.Hive.CloudManager.Azure.Constants.InstanceSize size =
     89         (HeuristicLab.Clients.Hive.CloudManager.Azure.Constants.InstanceSize)Enum.Parse(
     90           typeof(HeuristicLab.Clients.Hive.CloudManager.Azure.Constants.InstanceSize),
     91           instanceSize,
     92           true);
     93        return (int)size;
     94      } else {
     95        return 0;
     96      }
     97
    8398    }
    8499  }
Note: See TracChangeset for help on using the changeset viewer.