public void LogProblem(string exceptionText, BindingValue value = null, PropertyInfo property = null) { var problem = new ConvertProblem { ExceptionText = exceptionText, Item = Object, Property = property, Value = value }; _problems.Add(problem); }
public bool Equals(BindingValue other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.RawKey, RawKey) && Equals(other.Source, Source) && Equals(other.RawValue, RawValue)); }
public void SetUp() { _registry = new BindingRegistry(); _property = typeof (PropertyHolder).GetProperty("Property"); _numericTypeFamily = _registry.AllConverterFamilies().FirstOrDefault(cf => cf.Matches(_property)) as NumericTypeFamily; _numericTypeFamily.ShouldNotBeNull(); _context = MockRepository.GenerateMock<IPropertyContext>(); _context.Stub(x => x.Property).Return(_property); _propertyValue = new BindingValue { RawValue = "1.000,001" }; _context.Expect(c => c.RawValueFromRequest).Return(_propertyValue).Repeat.Times(4); }
public void ForProperty(PropertyInfo property, Action <IPropertyContext> action) { try { var propertyContext = new PropertyContext(this, _locator, property); action(propertyContext); } catch (Exception ex) { BindingValue value = null; _requestData.Value(property.Name, o => value = o); LogProblem(ex, value, property); } }
public BindingValue RawValue(string name) { BindingValue value = null; _namingStrategies.Any(naming => { string n = naming(name); return(_rawData.Value(n, x => value = x)); }); if (value != null) { _logger.UsedValue(value); } return(value); }
public void LogProblem(Exception ex, BindingValue value = null, PropertyInfo property = null) { LogProblem(ex.ToString(), value, property); }
public bool Equals(BindingValue other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.RawKey, RawKey) && Equals(other.Source, Source) && Equals(other.RawValue, RawValue); }