private void LoadConfigs()
        {
            string path = Application.dataPath + "/" + ConfigPath.CONFIG;

            if (!Directory.Exists(path))
            {
                this.HandleError($"Local configuration folder '{path}' was not found");
            }
            else
            {
                try
                {
                    FileSystemConfigsImporter importer = new FileSystemConfigsImporter();
                    this.configurationProfile = new ConfigurationProfileImpl(null);
                    ConfigTreeNodeImpl configTreeNode = importer.Import <ConfigTreeNodeImpl>(path, this.configurationProfile);
                    ((ConfigurationServiceImpl)ConfigurationService).SetRootConfigNode(configTreeNode);
                    this.configurationProfile = new ConfigurationProfileImpl(this.GetProfiles());
                    configTreeNode            = importer.Import <ConfigTreeNodeImpl>(path, this.configurationProfile);
                    ((ConfigurationServiceImpl)ConfigurationService).SetRootConfigNode(configTreeNode);
                    LocalConfiguration.rootConfigNode = configTreeNode;
                    this.SetLoadingStopTimeout();
                    base.Complete();
                }
                catch (Exception exception)
                {
                    this.HandleError($"Invalid local configuration data. Path: {path}, Error: {exception.Message}", exception);
                }
            }
        }
Exemplo n.º 2
0
        public static void SetTestConfigs(ConfigurationServiceImpl configurationService, string path)
        {
            if (!Directory.Exists(path))
            {
                throw new ConfigsNotFoundException("Configs directory '" + path + "' was not found.");
            }
            ConfigTreeNodeImpl configTreeNode = new FileSystemConfigsImporter().Import <ConfigTreeNodeImpl>(path, new ConfigurationProfileImpl(null));

            configurationService.SetRootConfigNode(configTreeNode);
        }
Exemplo n.º 3
0
        public static void SetDefaultConfigs(ConfigurationServiceImpl configurationService)
        {
            string str;
            FileSystemConfigsImporter importer = new FileSystemConfigsImporter();

            if (Directory.Exists(MAVEN_CONFIG_PATH))
            {
                str = MAVEN_CONFIG_PATH;
            }
            else
            {
                if (!Directory.Exists(IDE_CONFIG_PATH))
                {
                    string[] textArray1 = new string[] { "Configs directory was not found. Path for maven: ", MAVEN_CONFIG_PATH, ". Path for IDE: ", IDE_CONFIG_PATH, "." };
                    throw new ConfigsNotFoundException(string.Concat(textArray1));
                }
                str = IDE_CONFIG_PATH;
            }
            ConfigTreeNodeImpl configTreeNode = importer.Import <ConfigTreeNodeImpl>(str, new ConfigurationProfileImpl(null));

            configurationService.SetRootConfigNode(configTreeNode);
        }