public void Setup()
        {
            var servicesAdmin = ServiceManager.Create();
            var services      = servicesAdmin.Manager;

            IService service;
            var      loggerService = new MainLogger(out service);

            services.Register(service);
            var queueService = new HostApplicationActionQueue(out service);

            services.Register(service);

            TaskContextDummy taskContext = new TaskContextDummy();

            servicesAdmin.StartServices(taskContext);

            queue = services.Get <IHostApplicationActionQueue>();
        }
Ejemplo n.º 2
0
        internal static ServiceManager.IServiceManagerAdministration CreateFileParsingSetup(Assembly testAssembly, params ScriptFile[] files)
        {
            ServiceManager.IServiceManagerAdministration services = ServiceManager.Create();
            LastServiceManager = services;

            IService service;
            var      addonManager = new AddonManager(null, out service);

            services.Manager.Register(service);
            var objectManager = new DynamicObjectManager(out service);

            services.Manager.Register(service);
            var loadedFiles = new LoadedFilesManager(out service);

            services.Manager.Register(service);
            var mainLogger = new MainLogger(out service);

            services.Manager.Register(service);
            var taskManager = new TaskManager(out service);

            services.Manager.Register(service);

            TaskContextDummy taskContext = new TaskContextDummy();

            services.StartServices(taskContext);

            addonManager.AddAssembly(typeof(System.Convert).Assembly, false);
            addonManager.AddAssembly(typeof(Math).Assembly, false);
            addonManager.AddAssembly(typeof(Enumerable).Assembly, false);
            addonManager.AddAssembly(AddonManager.StepBroCoreAssembly, true);

            if (testAssembly != null)
            {
                addonManager.AddAssembly(testAssembly, false);
            }

            foreach (var f in files)
            {
                loadedFiles.RegisterLoadedFile(f);
            }

            return(services);
        }