public void Configure(IWindsorContainer container)
 {
     container.AddFacility<ComponentBehaviorsFacility>();
     var config = new BehaviorDictionary();
     config.For<Worker>().Add<DataErrorInfoBehavior>().Add<NotifyPropertyChangedBehavior>();
     container.Register(Component.For<Worker>().LifeStyle.Transient);
     container.Register(Component.For<IEntityFactory>().ImplementedBy<EntityFactory>());
 }
        public void Configure(IWindsorContainer container)
        {
            container.AddFacility<ComponentBehaviorsFacility>();
            var config = new BehaviorDictionary();
            config.For<Worker>().Add<DataErrorInfoBehavior>()
                            .Add<NotifyPropertyChangedBehavior>();
            config.For<WareGroup>().Add<DataErrorInfoBehavior>()
                .Add<NotifyPropertyChangedBehavior>();

            container.Register(Component.For<IBehaviorStore>().Instance(config));

            container.Register(Component.For<WareGroup>()
                                .OnCreate((kernel, wareGroup) => wareGroup.Children = new ObservableCollection<WareGroup>())
                                .LifeStyle.Transient);

            container.Register(Component.For<IEntityFactory>()
                               	.ImplementedBy<EntityFactory>());
        }
Esempio n. 3
0
        protected override void ConfigureWindsorContainer()
        {
            container.AddFacility <FactorySupportFacility>();
            container.AddFacility <ComponentBehaviorsFacility>();
            var config = new BehaviorDictionary();

            config.For <Album>().Add <NotifyPropertyChangedBehavior>().Add <EditableBehavior>();
            container.Register(Component.For <IBehaviorStore>().Instance(config));
        }
        public void can_push_and_pull_multiples_behaviors()
        {
            var defaultBehaviorStore = new BehaviorDictionary();

            defaultBehaviorStore.For <Decimal>()
            .Add <SampleBehavior>()
            .Add <SecondSampleBehavior>();

            var behaviors = defaultBehaviorStore.GetBehaviorsForType(typeof(Decimal));

            behaviors.Should().Contain(typeof(SampleBehavior))
            .And.Contain(typeof(SecondSampleBehavior));
        }
Esempio n. 5
0
        protected override void ConfigureWindsorContainer()
        {
            container.AddFacility <FactorySupportFacility>();
            container.AddFacility <ComponentBehaviorsFacility>();

            //container.Register(Component.For<Album>().LifeStyle.Transient);
            //register the proxyfactoryfactory.
            container.Register(Component.For <IEntityValidator>().Instance(new Mock <IEntityValidator>().Object));

            //configure the behavior metadata
            var config = new BehaviorDictionary();

            config.For <Album>().Add <NotifyPropertyChangedBehavior>().Add <DataErrorInfoBehavior>();
            container.Register(Component.For <IBehaviorStore>().Instance(config));
        }
        public void FixtureSetUp()
        {
            container = new WindsorContainer();
            container.AddFacility <FactorySupportFacility>();

            //Add the facility
            container.AddFacility <ComponentBehaviorsFacility>();

            //configure behaviors
            var config = new BehaviorDictionary();

            config.For <Person>().Add <DataErrorInfoBehavior>();

            container.Register(Component.For <IBehaviorStore>().Instance(config));

            //Register a mock instance of EntityValidator.
            container.Register(Component.For <IEntityValidator>()
                               .Instance(CreateEntityValidator())
                               .LifeStyle.Singleton);

            //Register the entity
            container.Register(Component.For <Person>()
                               .LifeStyle.Transient);
        }
Esempio n. 7
0
        protected void AddBehavior(IWindsorContainer container)
        {
            //Register the Behavior
            _config = new BehaviorDictionary();
            //Adherence
            _config.For<AgentStatusType>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For<AgentStatus>().Add<AgentStatusBehavior>();
            //Administration
            _config.For<Employee>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For<LaborRule>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For<DayOffRule>().Add<NotifyPropertyChangedBehavior>();
            _config.For<MaskOfDay>().Add<NotifyPropertyChangedBehavior>();
            _config.For<Organization>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For<Skill>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            //Infrastructure
            //x_config.For<Acd>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            //x_config.For<AcdQueue>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For<Campaign>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>().Add<SelectableBehavior>();
            _config.For<CalendarEvent>().Add<NotifyPropertyChangedBehavior>();
            
            //_config.For<NationalHoliday>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For<Schedule>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditableBehavior>();
            _config.For<ServiceQueue>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            //Seating
            //x_config.For<Area>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditableBehavior>().Add<IndexableBehavior>();
            //x_config.For<OrganizationSeatingArea>().Add<NotifyPropertyChangedBehavior>().Add<EditableBehavior>();
            //x_config.For<Seat>().Add<NotifyPropertyChangedBehavior>().Add<EditableBehavior>().Add<SelectableBehavior>();
            //x_config.For<Site>().Add<NotifyPropertyChangedBehavior>().Add<EditableBehavior>();
            //x_config.For<SeatConsolidationRule>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>().Add<IndexableBehavior>();
            //x_config.For<SeatingEngineStatus>().Add<NotifyPropertyChangedBehavior>();
            //Shifts
            //x_config.For<SchedulingPayload>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>();
            _config.For<Attendance>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>();

            _config.For<Agent>().Add<NotifyPropertyChangedBehavior>();
            _config.For<PlanningAgent>().Add<NotifyPropertyChangedBehavior>().Add<IndexableBehavior>();
            _config.For<SubEventInsertRule>().Add<NotifyPropertyChangedBehavior>();
            _config.For<BasicAssignmentType>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<IndexableBehavior>().Add<EditingBehavior>();
            _config.For<AssignmentType>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<IndexableBehavior>().Add<EditingBehavior>();

            _config.For<TermStyle>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();

            //x_config.For<ShiftGroup>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For<Common.Domain.CompareToSelectedEntity<Employee>>().Add<NotifyPropertyChangedBehavior>();
            _config.For<ComparableOrganization>().Add<NotifyPropertyChangedBehavior>();

            container.Register(Component.For<IBehaviorStore>().Instance(_config));
        }
Esempio n. 8
0
        protected void AddBehavior(IWindsorContainer container)
        {
            //Register the Behavior
            _config = new BehaviorDictionary();
            //Adherence
            _config.For <AgentStatusType>().Add <NotifyPropertyChangedBehavior>().Add <EditingBehavior>().Add <EditableBehavior>();
            _config.For <AgentStatus>().Add <AgentStatusBehavior>();
            //Administration
            _config.For <Employee>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>().Add <EditingBehavior>().Add <EditableBehavior>();
            _config.For <LaborRule>().Add <NotifyPropertyChangedBehavior>().Add <EditingBehavior>().Add <EditableBehavior>();
            _config.For <DayOffRule>().Add <NotifyPropertyChangedBehavior>();
            _config.For <MaskOfDay>().Add <NotifyPropertyChangedBehavior>();
            _config.For <Organization>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>().Add <EditingBehavior>().Add <EditableBehavior>();
            _config.For <Skill>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>().Add <EditingBehavior>().Add <EditableBehavior>();
            //Infrastructure
            //x_config.For<Acd>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            //x_config.For<AcdQueue>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For <Campaign>().Add <NotifyPropertyChangedBehavior>().Add <EditingBehavior>().Add <EditableBehavior>().Add <SelectableBehavior>();
            _config.For <CalendarEvent>().Add <NotifyPropertyChangedBehavior>();

            //_config.For<NationalHoliday>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For <Schedule>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>().Add <EditableBehavior>();
            _config.For <ServiceQueue>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>().Add <EditingBehavior>().Add <EditableBehavior>();
            //Seating
            //x_config.For<Area>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>().Add<EditableBehavior>().Add<IndexableBehavior>();
            //x_config.For<OrganizationSeatingArea>().Add<NotifyPropertyChangedBehavior>().Add<EditableBehavior>();
            //x_config.For<Seat>().Add<NotifyPropertyChangedBehavior>().Add<EditableBehavior>().Add<SelectableBehavior>();
            //x_config.For<Site>().Add<NotifyPropertyChangedBehavior>().Add<EditableBehavior>();
            //x_config.For<SeatConsolidationRule>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>().Add<IndexableBehavior>();
            //x_config.For<SeatingEngineStatus>().Add<NotifyPropertyChangedBehavior>();
            //Shifts
            //x_config.For<SchedulingPayload>().Add<NotifyPropertyChangedBehavior>().Add<SelectableBehavior>();
            _config.For <Attendance>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>();

            _config.For <Agent>().Add <NotifyPropertyChangedBehavior>();
            _config.For <PlanningAgent>().Add <NotifyPropertyChangedBehavior>().Add <IndexableBehavior>();
            _config.For <SubEventInsertRule>().Add <NotifyPropertyChangedBehavior>();
            _config.For <BasicAssignmentType>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>().Add <IndexableBehavior>().Add <EditingBehavior>();
            _config.For <AssignmentType>().Add <NotifyPropertyChangedBehavior>().Add <SelectableBehavior>().Add <IndexableBehavior>().Add <EditingBehavior>();

            _config.For <TermStyle>().Add <NotifyPropertyChangedBehavior>().Add <EditingBehavior>().Add <EditableBehavior>();

            //x_config.For<ShiftGroup>().Add<NotifyPropertyChangedBehavior>().Add<EditingBehavior>().Add<EditableBehavior>();
            _config.For <Common.Domain.CompareToSelectedEntity <Employee> >().Add <NotifyPropertyChangedBehavior>();
            _config.For <ComparableOrganization>().Add <NotifyPropertyChangedBehavior>();

            container.Register(Component.For <IBehaviorStore>().Instance(_config));
        }