Example #1
0
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(AllTypes.FromAssemblyNamed("com.Sconit.Service")
                               .Pick().If(t => t.Name.EndsWith("MgrImpl") &&
                                          !t.Name.Equals("GenericMgrImpl") &&
                                          !t.Name.Equals("QueryImpl") &&
                                          !t.Name.Equals("EmailMgrImpl") &&
                                          !t.Name.Equals("ShortMessageMgrImpl") &&
                                          !t.Name.Equals("PubSubMgrImpl") &&
                                          !t.Name.Equals("SecurityMgrImpl"))
                               .Configure(c => c.LifeStyle.Singleton)
                               .WithService.DefaultInterface()
                               );

            //container.Register(AllTypes.FromAssemblyNamed("com.Sconit.Service.SAP")
            // .Pick().If(t => t.Name.EndsWith("MgrImpl"))
            // .Configure(c => c.LifeStyle.Singleton)
            // .WithService.DefaultInterface()
            // );
            //Parameter p1 = Parameter.ForKey("dao").Eq("${mainDao}");
            //container.Register(Component.For<IGenericMgr>()
            //    .Named("genericMgr")
            //    .LifeStyle.Singleton
            //    .Parameters(p1)
            //    .ImplementedBy<GenericMgrImpl>()
            //   );
        }
Example #2
0
        public static void Initialize()
        {
            Container = new WindsorContainer();

            Container.AddFacility <WcfFacility>();

            Container.Register(
                AllTypes.FromAssemblyNamed("DogmaticWcf.Server.Services")
                .Pick().If(type => type.GetInterfaces().Any(i => i.IsDefined(typeof(ServiceContractAttribute), true)))
                .Configure(configurer => configurer
                           .Named(configurer.Implementation.Name)
                           .LifeStyle.PerWcfOperation()
                           .AsWcfService(
                               new DefaultServiceModel()
                               .AddEndpoints(
                                   WcfEndpoint.BoundTo(new NetTcpBinding {
                PortSharingEnabled = true
            }).At(string.Format("net.tcp://localhost:6969/{0}", configurer.Implementation.Name)),
                                   WcfEndpoint.BoundTo(new NetNamedPipeBinding()).At(string.Format("net.pipe://localhost/{0}", configurer.Implementation.Name)))
                               .PublishMetadata()
                               )
                           )
                .WithService.Select((type, baseTypes) => type.GetInterfaces().Where(i => i.IsDefined(typeof(ServiceContractAttribute), true)))
                );
        }
Example #3
0
        public static void Inject()
        {
            var container = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <Castle.Windsor.IWindsorContainer>();

            //Hardcoded resolution
            //container.Register(AllTypes.FromAssembly(typeof(PersonService).Assembly)
            //    .BasedOn<IBaseService>()
            //    .WithService.FromInterface()
            //    .LifestyleTransient());

            container.Register(
                AllTypes.FromAssemblyNamed("PluggedMVC.Infrastructure.Repository")
                .Where(type => type.IsPublic)
                .WithService.AllInterfaces()
                .LifestyleTransient());

            container.Register(
                AllTypes.FromAssemblyNamed("PluggedMVC.Infrastructure.Service")
                .Where(type => type.IsPublic)
                .WithService.FirstInterface()
                .LifestyleTransient());

            container.Register(
                Component.For <AdventureWorksEntities>()
                .ImplementedBy <AdventureWorksEntities>()
                .LifeStyle.PerWebRequest);
        }
Example #4
0
 static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("Cotide.Infrastructure").Pick()
         .WithService.FirstNonGenericCoreInterface("Cotide.Domain"));
 }
 private static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchTemplate.Infrastructure")
         .BasedOn(typeof(IRepositoryWithTypedId <,>))
         .WithService.DefaultInterfaces());
 }
 private static void AddQueryObjectsTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("YTech.ProductMgt.JayaMesin.Web.Mvc")
         .Pick()
         .WithService.FirstInterface());
 }
 private static void AddCommandsTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("YTech.ProductMgt.JayaMesin.Tasks")
         .Pick()
         .WithService.FirstInterface());
 }
 private static void AddQueryObjectsTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchCookbook.Web.Mvc")
         .BasedOn <NHibernateQuery>()
         .WithService.FirstInterface());
 }
 private static void AddCommandHandlersTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchCookbook.Tasks")
         .BasedOn(typeof(ICommandHandler <>))
         .WithService.FirstInterface());
 }
Example #10
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchTemplate.Tasks")
         .Pick().Unless(t => t.Namespace.EndsWith("Handlers"))
         .WithService.DefaultInterfaces());
 }
 private static void AddQueryObjectsTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("JayaHarmoni.Web.Mvc")
         .Pick()
         .WithService.FirstInterface());
 }
Example #12
0
 static void AddQueryServicesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("Cotide.QueryServices").Pick()
         .WithService.FirstInterface());
 }
Example #13
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchTemplate.Web.Mvc")
         .InNamespace("SharpArchTemplate.Web.Mvc.Controllers.Queries", true)
         .WithService.DefaultInterfaces());
 }
Example #14
0
 private static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("Suteki.TardisBank.Infrastructure")
         .BasedOn(typeof(IRepositoryWithTypedId <,>))
         .WithService.DefaultInterfaces().LifestyleTransient());
 }
 private static void AddCommandsTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("JayaHarmoni.Tasks")
         .Pick()
         .WithService.FirstInterface());
 }
 private static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("SharpArchitecture.MultiTenant.Data")
         .Pick()
         .WithService.FirstNonGenericCoreInterface("SharpArchitecture.MultiTenant.Core"));
 }
 private static void AddCommandHandlersTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchitecture.MultiTenant.ApplicationServices").Pick()
         .If(f => !string.IsNullOrEmpty(f.Namespace) && f.Namespace.Contains(".CommandHandlers"))
         .Configure(c => c.LifeStyle.Is(LifestyleType.Transient))
         .WithService.FirstInterface());
 }
 private static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("SharpArchCookbook.Infrastructure")
         .BasedOn(typeof(IRepositoryWithTypedId <,>))
         .WithService.FirstNonGenericCoreInterface("SharpArchCookbook.Domain"));
 }
Example #19
0
 private static void AddCustomDaosTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed(ProjectHierarchy.DataNS)
         .BasedOn(typeof(IGenericDaoWithTypedId <,>))
         .WithService.FirstNonGenericCoreInterface(ProjectHierarchy.DomainNS));
 }
 private static void AddTasksTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("YTech.ProductMgt.JayaMesin.Tasks")
         .Pick()
         .WithService.FirstNonGenericCoreInterface("YTech.ProductMgt.JayaMesin.Domain"));
 }
 private static void AddQueriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("SharpArchitecture.MultiTenant.Web").Pick()
         .If(f => !string.IsNullOrEmpty(f.Namespace) && f.Namespace.Contains(".Queries"))
         .Configure(c => c.LifeStyle.Is(LifestyleType.Transient))
         .WithService.FirstNonGenericCoreInterface("SharpArchitecture.MultiTenant.Web.Controllers"));
 }
Example #22
0
 private static void AddApplicationServicesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("YTech.IM.Erha.ApplicationServices")
         .Pick()
         .WithService.FirstInterface());
 }
Example #23
0
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         AllTypes.FromAssemblyNamed("TestProject").Pick(),
         Classes.FromAssemblyNamed("TestProject").Pick(),
         Castle.MicroKernel.Registration.Types.FromAssemblyNamed("TestProject").Pick()
         );
 }
 private static void AddTasksTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("JayaHarmoni.Tasks")
         .Pick()
         .WithService.FirstNonGenericCoreInterface("JayaHarmoni.Domain"));
 }
 private static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("YTech.ProductMgt.JayaMesin.Infrastructure")
         .Pick()
         .WithService.FirstNonGenericCoreInterface("YTech.ProductMgt.JayaMesin.Domain"));
 }
        protected override void RegisterImplementationsOfIRegistration()
        {
            LookForRegistrations.AssemblyNames
            .ForEach(n => Container.Register(AllTypes.FromAssemblyNamed(n).BasedOn <IWindsorRegistration>()));

            LookForRegistrations.Assemblies
            .ForEach(a => Container.Register(AllTypes.FromAssembly(a).BasedOn <IWindsorRegistration>()));
        }
 private static void AddApplicationServicesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("SharpArchitecture.MultiTenant.ApplicationServices")
         .Pick()
         .WithService.FirstInterface());
 }
 private static void AddTasksTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("SharpArchCookbook.Tasks")
         .Pick().If(t => t.Name.EndsWith("Tasks"))
         .WithService.FirstNonGenericCoreInterface("SharpArchCookbook.Domain"));
 }
Example #29
0
 private static void AddCustomRepositoriesTo(IWindsorContainer container)
 {
     container.Register(
         AllTypes
         .FromAssemblyNamed("YTech.IM.Erha.Data")
         .Pick()
         .WithService.FirstNonGenericCoreInterface("YTech.IM.Erha.Core"));
 }
 /// <summary>
 /// Performs the installation in the <see cref="T:Castle.Windsor.IWindsorContainer"/>.
 /// </summary>
 /// <param name="container">The container.</param><param name="store">The configuration store.</param>
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(Component.For <IWindsorContainer>().Instance(container)); // return itself when a request comes in to resolve the container
     container.Register(AllTypes.FromAssemblyNamed("ChopShop.Admin.Services")
                        .Pick()
                        .Configure(x => x.LifeStyle.PerWebRequest)
                        .WithService.FirstInterface());
 }