Ejemplo n.º 1
0
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            base.Load(moduleBuilder);

            moduleBuilder.RegisterModule<Zetbox.App.Projekte.Common.CustomCommonActionsModule>();

            moduleBuilder.RegisterZetboxImplementors(typeof(CustomClientActionsModule).Assembly);
            moduleBuilder.RegisterViewModels(typeof(CustomClientActionsModule).Assembly);
        }
Ejemplo n.º 2
0
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            base.Load(moduleBuilder);

            moduleBuilder.RegisterModule<Common.CommonModule>();

            // Register additional module dependencies, for example workflow and parties
            // moduleBuilder.RegisterModule<Zetbox.Workflow.Client.ClientModule>();
            // moduleBuilder.RegisterModule<Zetbox.Parties.Client.ClientModule>();

            moduleBuilder.RegisterZetboxImplementors(typeof(ClientModule).Assembly);
            moduleBuilder.RegisterViewModels(typeof(ClientModule).Assembly);

            // Register explicit overrides here
        }
Ejemplo n.º 3
0
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            base.Load(moduleBuilder);

            moduleBuilder.RegisterModule<Zetbox.API.Common.ApiCommonModule>();
            moduleBuilder.RegisterModule<Zetbox.API.Client.ClientApiModule>();

            moduleBuilder
                .Register<ViewModelDependencies>(c => new ViewModelDependencies(
                    c.Resolve<IViewModelFactory>(),
                    c.Resolve<IFrozenContext>(),
                    c.Resolve<IPrincipalResolver>(),
                    c.Resolve<IIconConverter>(),
                    c.Resolve<IAssetsManager>(),
                    c.Resolve<IValidationManager>(),
                    c.Resolve<IPerfCounter>()))
                .As<IViewModelDependencies>();

            moduleBuilder
                .Register<LoggingProblemReporter>(c => new LoggingProblemReporter())
                .As<IProblemReporter>()
                .SingleInstance();

            moduleBuilder
                .Register<ZetboxContextHttpScope>(c => new ZetboxContextHttpScope(c.Resolve<IZetboxContext>(), c.Resolve<IMVCValidationManager>()))
                .InstancePerHttpRequest();

            moduleBuilder
                .RegisterType<AspNetViewModelFactory>()
                .As<IViewModelFactory>()
                .As<IToolkit>()
                .InstancePerLifetimeScope(); // Not per HTTP Request, as custom actions also need a ViewModelFactory. They'll get the root scope.

            moduleBuilder
                .RegisterType<Zetbox.Client.GUI.DialogCreator>()
                .AsSelf()
                .InstancePerDependency();

            moduleBuilder
                .RegisterType<MVCValidationManager>()
                .As<IValidationManager>()
                .As<IMVCValidationManager>()
                .InstancePerHttpRequest();

            moduleBuilder.RegisterViewModels(typeof(ClientModule).Assembly);
            moduleBuilder.RegisterModule((Module)Activator.CreateInstance(Type.GetType("Zetbox.App.Projekte.Client.CustomClientActionsModule, Zetbox.App.Projekte.Client", true)));
        }
Ejemplo n.º 4
0
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            base.Load(moduleBuilder);

            moduleBuilder.RegisterZetboxImplementors(typeof(CustomClientActionsModule).Assembly);
            moduleBuilder.RegisterViewModels(typeof(CustomClientActionsModule).Assembly);

            // Register explicit overrides here
            moduleBuilder
                .Register<Zetbox.App.Projekte.Client.Projekte.Reporting.ReportingHost>(c => new Zetbox.App.Projekte.Client.Projekte.Reporting.ReportingHost(
                        "Zetbox.App.Projekte.Client.DerivedReportTest",
                        typeof(CustomClientActionsModule).Assembly,
                        c.Resolve<IFileOpener>(),
                        c.Resolve<ITempFileService>()
                    )
                )
                .InstancePerDependency();
        }
Ejemplo n.º 5
0
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            base.Load(moduleBuilder);

            moduleBuilder
                .Register<SynchronousThreadManager>(c => new SynchronousThreadManager())
                .As<IAsyncThreadManager>()
                .As<IUiThreadManager>();

            moduleBuilder
                .Register<ViewModelDependencies>(c => new ViewModelDependencies(
                    c.Resolve<IViewModelFactory>(),
                    c.Resolve<IUiThreadManager>(),
                    c.Resolve<IAsyncThreadManager>(),
                    c.Resolve<IFrozenContext>(),
                    c.Resolve<IIdentityResolver>()))
                .As<IViewModelDependencies>();

            moduleBuilder
                .Register<ThreadPrincipalResolver>(c=> new ThreadPrincipalResolver(c.Resolve<Func<IReadOnlyZetboxContext>>()))
                .As<IIdentityResolver>()
                .InstancePerLifetimeScope();

            moduleBuilder
                .Register<LoggingProblemReporter>(c => new LoggingProblemReporter())
                .As<IProblemReporter>()
                .SingleInstance();

            moduleBuilder
                .Register<DefaultCredentialsResolver>(c => new DefaultCredentialsResolver())
                .As<ICredentialsResolver>()
                .SingleInstance();

            moduleBuilder
                .RegisterType<Zetbox.Client.GUI.DialogCreator>()
                .AsSelf()
                .InstancePerDependency();

            moduleBuilder.RegisterViewModels(typeof(ClientModule).Assembly);
        }
Ejemplo n.º 6
0
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            base.Load(moduleBuilder);

            moduleBuilder.RegisterModule<Zetbox.API.Common.ApiCommonModule>();
            moduleBuilder.RegisterModule<Zetbox.API.Client.ClientApiModule>();

            moduleBuilder
                .Register<ViewModelDependencies>(c => new ViewModelDependencies(
                    c.Resolve<IViewModelFactory>(),
                    c.Resolve<IFrozenContext>(),
                    c.Resolve<IPrincipalResolver>(),
                    c.Resolve<IIconConverter>(),
                    c.Resolve<IAssetsManager>(),
                    c.Resolve<IValidationManager>(),
                    c.Resolve<IPerfCounter>()))
                .As<IViewModelDependencies>();

            moduleBuilder
                .Register<LifetimeScopeFactory>(c => new LifetimeScopeFactory(c.Resolve<ILifetimeScope>()))
                .As<ILifetimeScopeFactory>()
                .SingleInstance();

            moduleBuilder
                .Register<ThreadPrincipalResolver>(c => new ThreadPrincipalResolver(c.Resolve<ILifetimeScope>()))
                .As<IPrincipalResolver>()
                .SingleInstance();

            moduleBuilder
                .Register<LoggingProblemReporter>(c => new LoggingProblemReporter())
                .As<IProblemReporter>()
                .SingleInstance();

            moduleBuilder
                .Register<DefaultCredentialsResolver>(c => new DefaultCredentialsResolver())
                .As<ICredentialsResolver>()
                .SingleInstance();

            moduleBuilder
                .RegisterType<Zetbox.Client.GUI.DialogCreator>()
                .AsSelf()
                .InstancePerDependency();

            moduleBuilder
                .RegisterType<ZetboxContextExceptionHandler>()
                .As<IZetboxContextExceptionHandler>()
                .SingleInstance();

            moduleBuilder
                .RegisterType<Zetbox.Client.Reporting.ReportingErrorDialog>()
                .AsImplementedInterfaces()
                .InstancePerDependency();

            moduleBuilder
               .RegisterType<ValidationManager>()
               .As<IValidationManager>()
               .InstancePerLifetimeScope();

            moduleBuilder
                .Register<Zetbox.Client.Reporting.ReportingHost>(c => new Zetbox.Client.Reporting.ReportingHost(
                        "Zetbox.App.Projekte.Client.DerivedReportTest",
                        typeof(ClientModule).Assembly,
                        c.Resolve<IFileOpener>(),
                        c.Resolve<ITempFileService>(),
                        c.Resolve<IReportingErrorReporter>()
                    )
                )
                .InstancePerDependency();

            moduleBuilder
                .RegisterType<UIExceptionReporter>()
                .As<IUIExceptionReporter>()
                .SingleInstance();

            moduleBuilder.RegisterViewModels(typeof(ClientModule).Assembly);

            moduleBuilder.RegisterModule((Module)Activator.CreateInstance(Type.GetType("Zetbox.DalProvider.Client.ClientProvider, Zetbox.DalProvider.ClientObjects", true)));
            moduleBuilder.RegisterModule((Module)Activator.CreateInstance(Type.GetType("Zetbox.App.Projekte.Client.CustomClientActionsModule, Zetbox.App.Projekte.Client", true)));
        }
Ejemplo n.º 7
0
        protected virtual void ConfigureContainerBuilder(ContainerBuilder builder)
        {
            builder.RegisterControllers(typeof(ZetboxMvcApplication).Assembly);
            builder.RegisterModelBinders(typeof(ZetboxMvcApplication).Assembly);
            builder.RegisterModelBinderProvider();

            // Register our model binder manual, as they also deal with derived impelementations
            builder
                .RegisterType<ZetboxViewModelBinderProvider>()
                .As<IZetboxViewModelBinderProvider>()
                .SingleInstance();

            builder
                .RegisterType<ZetboxViewModelBinder>()
                .As<IZetboxViewModelBinder>()
                .InstancePerHttpRequest(); // ZetboxViewModelBinder has some http request dependencies

            builder
                .RegisterType<LookupDictionaryModelBinderProvider>()
                .As<ILookupDictionaryModelBinderProvider>()
                .SingleInstance();

            builder
                .RegisterType<LookupDictionaryModelBinder>()
                .As<ILookupDictionaryModelBinder>()
                .SingleInstance();

            builder.RegisterModule<AspNetClientModule>();

            // Register zetbox specific ViewModels
            builder.RegisterViewModels(typeof(ZetboxMvcApplication).Assembly);

            // Register target applications specific Controller and ViewModels
            builder.RegisterControllers(this.GetType().Assembly);
            builder.RegisterViewModels(this.GetType().Assembly);
        }