コード例 #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (MetricTrigger == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "MetricTrigger");
     }
     if (ScaleAction == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ScaleAction");
     }
     if (MetricTrigger != null)
     {
         MetricTrigger.Validate();
     }
     if (ScaleAction != null)
     {
         ScaleAction.Validate();
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the ScaleRule class.
 /// </summary>
 /// <param name="metricTrigger">the trigger that results in a scaling
 /// action.</param>
 /// <param name="scaleAction">the parameters for the scaling
 /// action.</param>
 public ScaleRule(MetricTrigger metricTrigger, ScaleAction scaleAction)
 {
     MetricTrigger = metricTrigger;
     ScaleAction   = scaleAction;
     CustomInit();
 }