Exemple #1
0
        public static Container CreateInitializedContainer()
        {
            var result = ContainerInitializationService.CreateInitializedContainer(
                new AssemblyParameters(typeof(ContainerInitialization).Assembly, "Mmu.Mls"));

            return(result);
        }
Exemple #2
0
        public static void Start()
        {
            ContainerInitializationService.CreateInitializedContainer(new ContainerConfiguration(typeof(BootstrapService).Assembly, "Mmu.OrthographyService", true));
            var keyboardHookService = ServiceLocatorSingleton.Instance.GetService <IKeyboardHookService>();

            keyboardHookService.HookKeyboard();
        }
        private static void Main()
        {
            var containerConfig = ContainerConfiguration.CreateFromAssembly(typeof(Program).Assembly, logInitialization: true);
            var container       = ContainerInitializationService.CreateInitializedContainer(containerConfig);

            container.GetInstance <IPathInitializer>().InitializePath();
            container.GetInstance <IConsoleCommandsStartupService>().Start();
        }
Exemple #4
0
        private static IServiceProvider CreateServiceProvider(IServiceCollection services)
        {
            var container = ContainerInitializationService.CreateInitializedContainer(typeof(ServiceInitialization).Assembly);

            container.Populate(services);
            var result = container.GetInstance <IServiceProvider>();

            return(result);
        }
 public static async Task StartUpAsync(
     ContainerConfiguration containerConfig,
     ApplicationConfiguration appConfig,
     Maybe <Action> appInitializedCallbackMaybe)
 {
     ContainerInitializationService.CreateInitializedContainer(containerConfig);
     var appStartService = ServiceLocatorSingleton.Instance.GetService <IAppStartService>();
     await appStartService.StartUpAsync(containerConfig.RootAssembly, appConfig, appInitializedCallbackMaybe);
 }
Exemple #6
0
        public static void Start(Assembly rootAssembly)
        {
            ContainerInitializationService.CreateInitializedContainer(new AssemblyParameters(rootAssembly, "Mmu.Wss"));
            _nativeInputListener = ProvisioningServiceSingleton.Instance.GetService <INativeInputListener>();
            var loggingService = ProvisioningServiceSingleton.Instance.GetService <IWssLoggingService>();

            loggingService.LogLoadedRegistrationServices();
            _nativeInputListener.StartListening();
        }
Exemple #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var containerConfig = ContainerConfiguration.CreateFromAssembly(typeof(App).Assembly);

            using (var container = ContainerInitializationService.CreateInitializedContainer(containerConfig))
            {
                var window = container.GetInstance <MainWindow>();
                window.ShowDialog();
            }
        }
Exemple #8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var containerConfig = ContainerConfiguration.CreateFromAssembly(typeof(App).Assembly);

            _container = ContainerInitializationService.CreateInitializedContainer(containerConfig);

            var wn = _container.GetInstance <MainView>();

            wn.Show();
        }
        public static void AssureAppIsInitialized(Assembly rootAssembly = null)
        {
            if (!_isAppInitialized)
            {
                rootAssembly = rootAssembly ?? typeof(AppInitializationService).Assembly;

                ContainerInitializationService.CreateInitializedContainer(
                    new ContainerConfiguration(rootAssembly, "Mmu.Mlh.DataAccess", true));
            }

            _isAppInitialized = true;
        }
Exemple #10
0
        public static void Main()
        {
            var provisioningService =
                ContainerInitializationService.CreateInitializedContainer(new AssemblyParameters(typeof(Program).Assembly, "Mmu.Mlh"))
                .GetInstance <IProvisioningService>();

            var keyboardHookService = provisioningService.GetService <IKeyboardHookService>();
            var mouseHookService    = provisioningService.GetService <IMouseHookService>();

            mouseHookService.HookMouse();
            keyboardHookService.HookKeyboard();

            Application.Run();
        }
Exemple #11
0
        private static void Main()
        {
            ContainerInitializationService.CreateInitializedContainer(
                new ContainerConfiguration(typeof(Program).Assembly, "Mmu.Mlazh.LanguageService", true));

            _service = ServiceLocatorSingleton.Instance.GetService <ITranslationService>();

            _inputs = new Dictionary <ConsoleKey, Action>
            {
                { ConsoleKey.D1, RunAutoTranslate },
                { ConsoleKey.D2, RunTargetedTranslate }
            };

            EvaluateInput();
        }
        public static void Main()
        {
            var containerConfig = ContainerConfiguration.CreateFromAssembly(typeof(Program).Assembly);
            var serviceLocator  = ContainerInitializationService
                                  .CreateInitializedContainer(containerConfig)
                                  .GetInstance <IServiceLocator>();

            var senseHatFactory = serviceLocator.GetService <ISenseHatFactory>();
            var senseHat        = senseHatFactory.Create();
            var yellow          = new RgbColor(255, 231, 14);
            var black           = RgbColor.CreateBlack();

            while (true)
            {
                ReadAndShowTemperature(senseHat, yellow, black);
                Thread.Sleep(10000);
            }
        }