예제 #1
0
        protected override void Load(ContainerBuilder containerBuilder)
        {
            containerBuilder.RegisterType <MessengerService>().As <IMessengerService>().SingleInstance();
            containerBuilder.RegisterType <WindowService>().As <IWindowService>();
            containerBuilder.RegisterType <DialogInteractionService>().As <IDialogInteractionService>();
            containerBuilder.RegisterType <WindowsProcessService>().As <IWindowsProcessService>();
            containerBuilder.RegisterType <ReferenceDataVersionInformationService>().As <IReferenceDataVersionInformationService>();
            containerBuilder.RegisterType <ConnectivityService>().As <IConnectivityService>();

            containerBuilder.Register(c => new ReportFilterService(c.Resolve <ILifetimeScope>(), c.ResolveKeyed <Func <Module> >(IlrDesktopTaskKeys.ReportService)))
            .As <IReportFilterService>().SingleInstance();

            containerBuilder.RegisterType <DesktopServiceConfiguration>().As <IServiceConfiguration>();

            containerBuilder.RegisterType <DesktopContextFactory>().As <IDesktopContextFactory>();

            containerBuilder.Register(c => new ViewModelLocator()).SingleInstance();

            containerBuilder.Register(c =>
            {
                var settings = new DesktopServiceSettings();
                settings.LoadAsync(CancellationToken.None).Wait();
                return(settings);
            }).As <IDesktopServiceSettings>().SingleInstance();

            containerBuilder.RegisterType <APIConfiguration>().As <IAPIConfiguration>();
            containerBuilder.RegisterType <FeatureSwitchConfiguration>().As <IFeatureSwitchConfiguration>();
        }
예제 #2
0
        private static ContainerBuilder BuildContainerBuilder()
        {
            var containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterModule <CommandLineModule>();
            containerBuilder.RegisterModule <BaseModule>();

            var desktopServiceSettings = new DesktopServiceSettings();

            desktopServiceSettings.LoadAsync(CancellationToken.None).Wait();

            containerBuilder.RegisterInstance <DesktopServiceSettings>(desktopServiceSettings).As <IDesktopServiceSettings>();

            return(containerBuilder);
        }