public EntityEntryViewModel( IPropertyBinder <TEntity> binder = null, IEntitySelector entitySelector = null, IEntityDlgOpener dlgOpener = null, IEntityAutocompleteSelector <TEntity> autocompleteSelector = null, IEntityAdapter <TEntity> entityAdapter = null ) { if (binder != null) { this.EntityBinder = binder; } if (entitySelector != null) { this.EntitySelector = entitySelector; } if (dlgOpener != null) { this.DlgOpener = dlgOpener; } if (autocompleteSelector != null) { this.AutocompleteSelector = autocompleteSelector; } if (entityAdapter != null) { this.EntityAdapter = entityAdapter; } }
// This acts as a de facto PushProperty public void Chose(PropertyInfo property, IPropertyBinder binder) { // Don't do anything if this has happened in the middle of a set properties operation if (_models.Any()) { currentReport.AddProperty(property, binder); } }
public static void PopulatePropertyWithBinder(PropertyInfo property, IBindingContext context, IPropertyBinder propertyBinder) { context.Logger.Chose(property, propertyBinder); context.ForProperty(property, propertyContext => { propertyBinder.Bind(property, context); }); }
public void ChosePropertyBinder(PropertyInfo property, IPropertyBinder binder) { var selection = new PropertyBinderSelection { BinderType = binder.GetType(), PropertyName = property.Name, PropertyType = property.PropertyType }; _report.AddBindingDetail(selection); }
public void BindPropertyWith(IPropertyBinder binder, Expression <Func <T, object> > property, string rawValue = null) { if (rawValue != null) { Data(property, rawValue); } var prop = property.ToAccessor().InnerProperty; _actions.Add(context => StandardModelBinder.PopulatePropertyWithBinder(prop, context, binder)); }
public void ChosePropertyBinder(PropertyInfo property, IPropertyBinder binder) { var selection = new PropertyBinderSelection{ BinderType = binder.GetType(), PropertyName = property.Name, PropertyType = property.PropertyType }; _report.AddBindingDetail(selection); }
protected override void beforeEach() { theProperty = ReflectionHelper.GetProperty <Case>(x => x.Identifier); MockFor <IBindingContext>().Stub(x => x.Logger).Return(MockFor <IBindingLogger>()); thePropertyBinder = MockFor <IPropertyBinder>(); MockFor <IPropertyBinderCache>().Stub(x => x.BinderFor(theProperty)) .Return(thePropertyBinder); ClassUnderTest.PopulateProperty(typeof(Case), theProperty, MockFor <IBindingContext>()); }
public ClickHouseDatabase( ClickHouseConnectionSettings connectionSettings, IClickHouseCommandFormatter commandFormatter, IClickHouseConnectionFactory connectionFactory, IClickHouseQueryLogger queryLogger, IPropertyBinder propertyBinder) { _connectionSettings = connectionSettings; _commandFormatter = commandFormatter; _connectionFactory = connectionFactory; _queryLogger = queryLogger; _propertyBinder = propertyBinder; }
protected override void beforeEach() { theProperty = ReflectionHelper.GetProperty <Case>(x => x.Identifier); MockFor <IBindingContext>().Stub(x => x.Logger).Return(MockFor <IBindingLogger>()); thePropertyBinder = MockFor <IPropertyBinder>(); var registry = new BindingRegistry(); Services.Inject(registry); registry.Add(thePropertyBinder); thePropertyBinder.Stub(x => x.Matches(null)).IgnoreArguments().Return(true); ClassUnderTest.PopulateProperty(typeof(Case), theProperty, MockFor <IBindingContext>()); }
public void BindPropertyWith(IPropertyBinder binder, Expression <Func <T, object> > property, string rawValue = null) { if (rawValue != null) { Data(property, rawValue); } var prop = property.ToAccessor().InnerProperty; _actions.Add(context => { if (Model == null) { Model = new T(); } context.ForObject(Model, () => { Logger.Chose(typeof(T), new PropertyModelBinderStandin()); StandardModelBinder.PopulatePropertyWithBinder(prop, context, binder); Logger.FinishedModel(); }); }); }
void IBindingLogger.ChosePropertyBinder(PropertyInfo property, IPropertyBinder binder) { _writer.WriteLine(" Chose property binder {0} for {1}", binder, property.Name); }
public void Add(IPropertyBinder binder) { _propertyBinders.Add(binder); }
public CommonEEVMBuilder(IEEVMBuilderParameters buildParameters, IPropertyBinder <TEntity> propertyBinder = null) { this.parameters = buildParameters; this.PropertyBinder = propertyBinder; }
public PropertyBindingReport(PropertyInfo property, IPropertyBinder binder) { _property = property; _binder = binder; }
public void ChosePropertyBinder(PropertyInfo property, IPropertyBinder binder) { }
public void SetUp() { resolveDependencies = A.Fake<IResolveDependencies>(); propertyBinderCollection = A.Fake<IPropertyBinderCollection>(); propertyBinder = A.Fake<IPropertyBinder>(); bindingContext = A.Fake<IBindingContext>(); modelBinder = new DefaultModelBinder(resolveDependencies, propertyBinderCollection); A.CallTo(() => propertyBinderCollection.GetMatching(A<PropertyInfo>.Ignored)).Returns(propertyBinder); }
public void Chose(PropertyInfo property, IPropertyBinder binder) { }
public void AddProperty(PropertyInfo property, IPropertyBinder binder) { var report = new PropertyBindingReport(property, binder); _properties.Add(report); }
public BusinessRule(IPropertyBinder <TObject, TProperty> propertyBinder, Func <TObject, TProperty, string> description, Func <TObject, TProperty, bool> matchPredicate) { _propertyBinder = propertyBinder; _description = description; _matchPredicate = matchPredicate; }
public LegacyEEVMBuilder(ILegacyEEVMBuilderParameters legacyParameters, IPropertyBinder <TEntity> propertyBinder = null) : base(legacyParameters, propertyBinder) { this.legacyParameters = legacyParameters; }