Beispiel #1
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);
        }
Beispiel #2
0
        internal static void DeinitializeInternal(bool reset)
        {
            m_loadedFilesManager.UnloadAllFilesWithoutDependants();

            TaskContextDummy taskContext = new TaskContextDummy();

            m_serviceManagerAdmin.StopServices(taskContext, reset);

            if (reset)
            {
                m_serviceManagerAdmin    = null;
                m_mainLogger             = null;
                m_loadedFilesManager     = null;
                m_addonManager           = null;
                m_logSinkManager         = null;
                m_scriptExecutionManager = null;
                m_dynamicObjectManager   = null;
                m_uiCalculator           = null;

                m_serviceManagerAdmin = ServiceManager.Create();
            }
        }
Beispiel #3
0
        //public static object ExecutionHelper { get; private set; }

        static Main()
        {
            m_serviceManagerAdmin = ServiceManager.Create();
        }