예제 #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (TopLeft == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TopLeft");
     }
     if (TopRight == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TopRight");
     }
     if (BottomRight == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "BottomRight");
     }
     if (BottomLeft == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "BottomLeft");
     }
     if (TopLeft != null)
     {
         TopLeft.Validate();
     }
     if (TopRight != null)
     {
         TopRight.Validate();
     }
     if (BottomRight != null)
     {
         BottomRight.Validate();
     }
     if (BottomLeft != null)
     {
         BottomLeft.Validate();
     }
 }