예제 #1
0
 public override void Validate(Element element, PropertyInfo property, object value)
 {
     if (value == null)
     {
         throw new ValidationException(string.Format("Missing argument {0} for {1}!", property.Name, element.Name));
     }
 }
예제 #2
0
        public override void Validate(Element element, PropertyInfo property, object value)
        {
            if (property.PropertyType != typeof(string))
            {
                throw new ValidationWrongTypeException(string.Format("The {0} can only be used on {1} properties", GetType().Name, "string"));
            }

            if (!AllowEmpty)
            {
                if (string.IsNullOrEmpty((string)value))
                {
                    throw new ValidationException(string.Format("Argument {0} for {1} can't be empty!", property.Name, element.Name));
                }
            }
        }
예제 #3
0
 protected void BeginElement(Element element)
 {
     Runner.BeginElement(element);
 }
예제 #4
0
 public abstract void Validate(Element element, PropertyInfo property, object value);
예제 #5
0
 internal void BeginElement(Element element)
 {
     Parents.Push(element);
 }