Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/31/12 15:25:18 (13 years ago)
Author:
spimming
Message:

#1680:

  • If CloudManagerClient contains hostedservice, merge them in add-method
  • Merge methods added deployment and hostedservice
  • Update/merge treeview in CloudResourceView
  • Indicate a change of the trackbar (DeploymentView)
Location:
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Model
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Model/Deployment.cs

    r7429 r7433  
    9999      //this.Modified = deployment.Modified;
    100100      //this.NewInstanceCount = deployment.NewInstanceCount;
     101
     102      if (!this.Modified) {
     103        this.Modified = deployment.Modified;
     104        this.NewInstanceCount = deployment.NewInstanceCount;
     105      }
    101106    }
    102107  }
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Model/HostedService.cs

    r7402 r7433  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Common;
     
    6162      return new HostedService(this, cloner);
    6263    }
     64
     65    public void Merge(HostedService hostedService) {
     66      if (!this.Equals(hostedService)) {
     67        throw new ArgumentException("Objects must be equal to be merged.", "subscription");
     68      }
     69      this.ServiceName = hostedService.ServiceName;
     70      this.Url = hostedService.Url;
     71      this.Subscription = hostedService.Subscription;
     72      this.HostedServiceProperties = hostedService.HostedServiceProperties;
     73
     74      foreach (Deployment dep in hostedService.Deployments) {
     75        int idx = this.Deployments.IndexOf(dep);
     76        if (idx != -1) {
     77          this.Deployments[idx].Merge(dep);
     78        } else {
     79          this.Deployments.Add(dep);
     80        }
     81      }
     82
     83      foreach (Deployment dep in this.Deployments) {
     84        int idx = hostedService.Deployments.IndexOf(dep);
     85        if (idx == -1) {
     86          this.Deployments.Remove(dep);
     87        }
     88      }
     89    }
    6390  }
    6491}
Note: See TracChangeset for help on using the changeset viewer.