Exemple #1
0
        public static void LoadSystemConfig()
        {
            Execution.initInstrumentation();
            DataFlow = new DataFlowManager();
            Elements = new ElementManager();
            Nodes = new NodeManager();
            OutputControllers = new OutputControllerManager(
                new ControllerLinkingManagement<OutputController>(),
                new OutputDeviceCollection<OutputController>(),
                new OutputDeviceExecution<OutputController>());
            SmartOutputControllers = new SmartOutputControllerManager(
                new ControllerLinkingManagement<SmartOutputController>(),
                new OutputDeviceCollection<SmartOutputController>(),
                new OutputDeviceExecution<SmartOutputController>());
            Previews = new PreviewManager(
                new OutputDeviceCollection<OutputPreview>(),
                new OutputDeviceExecution<OutputPreview>());
            Contexts = new ContextManager();
            Filters = new FilterManager(DataFlow);
            ControllerLinking = new ControllerLinker();
            ControllerManagement = new ControllerFacade();
            ControllerManagement.AddParticipant(OutputControllers);
            ControllerManagement.AddParticipant(SmartOutputControllers);
            OutputDeviceManagement = new OutputDeviceFacade();
            OutputDeviceManagement.AddParticipant(OutputControllers);
            OutputDeviceManagement.AddParticipant(SmartOutputControllers);
            OutputDeviceManagement.AddParticipant(Previews);

            // Load system data in order of dependency.
            // The system data generally resides in the data branch, but it
            // may not be in the case of an alternate context.
            string systemDataPath = _GetSystemDataPath();
            // Load module data before system config.
            // System config creates objects that use modules that have data in the store.
            ModuleStore = _LoadModuleStore(systemDataPath) ?? new ModuleStore();
            SystemConfig = _LoadSystemConfig(systemDataPath) ?? new SystemConfig();

            Elements.AddElements(SystemConfig.Elements);
            Nodes.AddNodes(SystemConfig.Nodes);
            OutputControllers.AddRange(SystemConfig.OutputControllers.Cast<OutputController>());
            SmartOutputControllers.AddRange(SystemConfig.SmartOutputControllers.Cast<SmartOutputController>());
            Previews.AddRange(SystemConfig.Previews.Cast<OutputPreview>());
            ControllerLinking.AddRange(SystemConfig.ControllerLinking);
            Filters.AddRange(SystemConfig.Filters);

            DataFlow.Initialize(SystemConfig.DataFlow);
        }
Exemple #2
0
        private static bool _OperatingWithinContext(string systemConfigFilePath)
        {
            SystemConfig systemConfig = FileService.Instance.LoadSystemConfigFile(systemConfigFilePath);

            return(systemConfig != null && systemConfig.IsContext);
        }
Exemple #3
0
 public void SaveSystemConfigFile(SystemConfig systemConfig, string filePath)
 {
     IObjectPersistor<SystemConfig> persistor = PersistorFactory.Instance.CreateSystemConfigPersistor();
     persistor.SaveToFile(systemConfig, filePath);
 }
 public XmlSystemConfigFilePolicy(SystemConfig systemConfig, XElement content)
 {
     _systemConfig = systemConfig;
     _content = content;
 }
Exemple #5
0
 public void SaveSystemConfigFile(SystemConfig systemConfig)
 {
     string filePath = systemConfig.LoadedFilePath ?? SystemConfig.DefaultFilePath;
     SaveSystemConfigFile(systemConfig, filePath);
 }