コード例 #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Name == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Name");
     }
     if (Type == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Type");
     }
     if (LocationInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "LocationInfo");
     }
     if (LocationInfo != null)
     {
         LocationInfo.Validate();
     }
 }