string IDataErrorInfo.this[string columnName]
        {
            get
            {
                string ret = ValidateProperty(columnName);

                if (ret != string.Empty)
                {
                    if (!InvalidFields.Contains(columnName))
                    {
                        InvalidFields.Add(columnName);
                    }
                }
                else
                {
                    if (InvalidFields.Contains(columnName))
                    {
                        InvalidFields.Remove(columnName);
                    }
                }

                if (!_SubmitAttempted)
                {
                    ret = string.Empty;
                }

                return(ret);
            }
        }
 public ValidationObject(TModel model, PropertyInfo field, Pipeline pipe, FailLevel level,
                         ValidationFail fail)
 {
     Object = model;
     InvalidFields.Add(new InvalidFieldData(field, pipe, level, fail));
 }
Ejemplo n.º 3
0
        public void AddInvalidField <MODEL>(Expression <Func <MODEL, object> > fieldExpression)
        {
            var name = ReflectionHelper.GetAccessor(fieldExpression).Name;

            InvalidFields.Add(name);
        }