Exemplo n.º 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));
     }
 }
Exemplo n.º 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));
                }
            }
        }
Exemplo n.º 3
0
 protected void BeginElement(Element element)
 {
     Runner.BeginElement(element);
 }
Exemplo n.º 4
0
 public abstract void Validate(Element element, PropertyInfo property, object value);
Exemplo n.º 5
0
 internal void BeginElement(Element element)
 {
     Parents.Push(element);
 }