Beispiel #1
0
        internal static unsafe ScalingPolicyDescription CreateFromNative(IntPtr intPtr)
        {
            NativeTypes.FABRIC_SCALING_POLICY *casted = (NativeTypes.FABRIC_SCALING_POLICY *)intPtr;
            var scalingMechanism = ScalingMechanismDescription.CreateFromNative(casted->ScalingPolicyMechanism);
            var scalingTrigger   = ScalingTriggerDescription.CreateFromNative(casted->ScalingPolicyTrigger);

            return(new ScalingPolicyDescription(scalingMechanism, scalingTrigger));
        }
 internal static ScalingTriggerDescription GetCopy(ScalingTriggerDescription other)
 {
     if (other is AveragePartitionLoadScalingTrigger)
     {
         return(new AveragePartitionLoadScalingTrigger(other as AveragePartitionLoadScalingTrigger));
     }
     else if (other is AverageServiceLoadScalingTrigger)
     {
         return(new AverageServiceLoadScalingTrigger(other as AverageServiceLoadScalingTrigger));
     }
     else
     {
         return(null);
     }
 }
Beispiel #3
0
 internal static ScalingPolicyDescription GetCopy(ScalingPolicyDescription other)
 {
     return(new ScalingPolicyDescription(ScalingMechanismDescription.GetCopy(other.ScalingMechanism), ScalingTriggerDescription.GetCopy(other.ScalingTrigger)));
 }
Beispiel #4
0
 /// <summary>
 /// <para>Initializes a new instance of the <see cref="System.Fabric.Description.ScalingPolicyDescription" /> class with the specified mechanism and trigger. </para>
 /// </summary>
 public ScalingPolicyDescription(ScalingMechanismDescription mechanism, ScalingTriggerDescription trigger)
 {
     ScalingMechanism = mechanism;
     ScalingTrigger   = trigger;
 }