Ejemplo n.º 1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ProcessKey == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ProcessKey");
     }
     if (ProcessVersion == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ProcessVersion");
     }
     if (Name == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Name");
     }
     if (Environment != null)
     {
         Environment.Validate();
     }
     if (CurrentVersion != null)
     {
         CurrentVersion.Validate();
     }
     if (ReleaseVersions != null)
     {
         foreach (var element in ReleaseVersions)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
 }