Example #1
0
        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;
            }
        }
Example #2
0
 // 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);
     });
 }
Example #4
0
 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);
        }
Example #6
0
            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);
        }
Example #8
0
        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>());
        }
Example #9
0
 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();
                    });
                });
            }
Example #12
0
 void IBindingLogger.ChosePropertyBinder(PropertyInfo property, IPropertyBinder binder)
 {
     _writer.WriteLine("  Chose property binder {0} for {1}", binder, property.Name);
 }
Example #13
0
 public void Add(IPropertyBinder binder)
 {
     _propertyBinders.Add(binder);
 }
Example #14
0
 public CommonEEVMBuilder(IEEVMBuilderParameters buildParameters, IPropertyBinder <TEntity> propertyBinder = null)
 {
     this.parameters     = buildParameters;
     this.PropertyBinder = propertyBinder;
 }
 public PropertyBindingReport(PropertyInfo property, IPropertyBinder binder)
 {
     _property = property;
     _binder   = binder;
 }
Example #16
0
 public void ChosePropertyBinder(PropertyInfo property, IPropertyBinder binder)
 {
 }
 // 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);
     }
 }
Example #18
0
        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);
        }
Example #19
0
 public void Chose(PropertyInfo property, IPropertyBinder binder)
 {
 }
Example #20
0
        public void AddProperty(PropertyInfo property, IPropertyBinder binder)
        {
            var report = new PropertyBindingReport(property, binder);

            _properties.Add(report);
        }
 public PropertyBindingReport(PropertyInfo property, IPropertyBinder binder)
 {
     _property = property;
     _binder = binder;
 }
 public BusinessRule(IPropertyBinder <TObject, TProperty> propertyBinder, Func <TObject, TProperty, string> description, Func <TObject, TProperty, bool> matchPredicate)
 {
     _propertyBinder = propertyBinder;
     _description    = description;
     _matchPredicate = matchPredicate;
 }
 public void Add(IPropertyBinder binder)
 {
     _propertyBinders.Add(binder);
 }
Example #24
0
 public LegacyEEVMBuilder(ILegacyEEVMBuilderParameters legacyParameters, IPropertyBinder <TEntity> propertyBinder = null) : base(legacyParameters, propertyBinder)
 {
     this.legacyParameters = legacyParameters;
 }