Beispiel #1
0
        /// <summary>
        /// The on startup.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var container = DynamicContainer.Instance;

            container.AddFacility <WcfFacility>();

            container.Register(
                Component.For <IHandlingReportService>()
                .Named("handlingReportServiceClient")
                .LifeStyle.Transient
                .ActAs(DefaultClientModel
                       .On(WcfEndpoint.BoundTo(new BasicHttpBinding())
                           .At(new Uri("http://127.0.0.1:8089/HandlingReportServiceFacade"))
                           ))
                .LifeStyle.Transient);

            var viewModel = container.Resolve <HandlingReportViewModel>();

            var registerAppWindow = new RegisterAppWindow {
                DataContext = viewModel
            };

            registerAppWindow.Show();
        }
Beispiel #2
0
        private static void RegisterComponents(IWindsorContainer container)
        {
            container.Register(
                AllTypes.Pick()
                //Scan repository assembly for domain model interfaces implementation
                .FromAssemblyNamed("NDDDSample.Persistence.NHibernate")
                .WithService.FirstNonGenericCoreInterface("NDDDSample.Domain.Model"));

            container.AddComponent("bookingInterface",
                                   Type.GetType("NDDDSample.Application.IBookingService, NDDDSample.Application"),
                                   Type.GetType("NDDDSample.Application.Impl.BookingService, NDDDSample.Application"));

            container.AddComponent("routingService",
                                   Type.GetType("NDDDSample.Domain.Service.IRoutingService, NDDDSample.Domain"),
                                   Type.GetType("NDDDSample.Infrastructure.ExternalRouting.ExternalRoutingService, NDDDSample.Infrastructure.ExternalRouting"));

            container.AddFacility <WcfFacility>();

            container.Register(
                Component.For <MessageLifecycleBehavior>(),
                Component.For <UnitOfWorkBehavior>(),
                Component
                .For <IBookingServiceFacade>()
                .ImplementedBy <BookingServiceFacade>()
                .Named("BookingService")
                .LifeStyle.Transient
                .ActAs(new DefaultServiceModel()
                       .AddEndpoints(WcfEndpoint
                                     .BoundTo(new NetTcpBinding())
                                     //.At("net.tcp://localhost:8081/BookingServiceFacade")
                                     .At(String.Format("net.tcp://{0}/BookingServiceFacade", bookingRemoteServiceWorkerRoleEndpoint))
                                     // adds this message action to this endpoint
                                     .AddExtensions(new LifestyleMessageAction()
                                                    )
                                     ))
                );

            container.Register(
                Component
                .For <IGraphTraversalService>()
                .Named("pathfinderRemoteFacade")
                .LifeStyle.Transient
                .ActAs(DefaultClientModel
                       .On(WcfEndpoint.BoundTo(new NetTcpBinding())
                           .At(String.Format("net.tcp://{0}/GraphTraversalService", pathfinderRemoteServiceWorkerRoleEndpoint))
                           ))
                .LifeStyle.Transient);
        }
Beispiel #3
0
        private static void AddCustomRepositoriesTo(IWindsorContainer container)
        {
            container.Register(
                AllTypes.Pick()
                //Scan repository assembly for domain model interfaces implementation
                .FromAssemblyNamed("NDDDSample.Persistence.NHibernate")
                .WithService.FirstNonGenericCoreInterface("NDDDSample.Domain.Model"));

            container.AddFacility <WcfFacility>();

            container.Register(
                Component.For <MessageLifecycleBehavior>(),
                Component.For <IBookingServiceFacade>()
                .Named("bookingServiceFacade")
                .LifeStyle.Transient
                .ActAs(DefaultClientModel
                       .On(WcfEndpoint.BoundTo(new NetTcpBinding())
                           .At(String.Format("net.tcp://{0}/BookingServiceFacade", bookingRemoteServiceWorkerRoleEndpoint))
                           )));
        }