Пример #1
0
        private void CopyFrom(ServiceTypeDescription other)
        {
            // Copy basic types
            this.PlacementConstraints = other.PlacementConstraints;
            this.ServiceTypeName      = other.ServiceTypeName;

            // Create copies of reference types
            this.Policies.AddRange(other.Policies.Select(p => p.GetCopy()));

            ServiceLoadMetricDescription.CopyFrom(other.LoadMetrics, this.LoadMetrics);

            this.extensions = other.Extensions == null ? this.extensions : new Dictionary <string, string>(other.Extensions);
        }
Пример #2
0
        private void CopyFrom(ServiceDescription other)
        {
            // Copy basic types
            this.PlacementConstraints         = other.PlacementConstraints;
            this.ServiceTypeName              = other.ServiceTypeName;
            this.ApplicationName              = other.ApplicationName;
            this.ServiceName                  = other.ServiceName;
            this.InitializationData           = other.InitializationData == null ? null : other.InitializationData.ToArray();
            this.isDefaultMoveCostSpecified   = other.IsDefaultMoveCostSpecified;
            this.defaultMoveCost              = other.defaultMoveCost;
            this.ServiceDnsName               = other.ServiceDnsName;
            this.ServicePackageActivationMode = other.ServicePackageActivationMode;

            ServiceLoadMetricDescription.CopyFrom(other.Metrics, this.Metrics);

            this.correlations.AddRange(other.Correlations.Select(c => new ServiceCorrelationDescription(c)));
            this.PartitionSchemeDescription = other.PartitionSchemeDescription.GetCopy();
            this.placementPolicies.AddRange(other.placementPolicies.Select(p => p.GetCopy()));
            this.scalingPolicies.AddRange(other.ScalingPolicies.Select(p => ScalingPolicyDescription.GetCopy(p)));
        }