private void InitLibrariesFromConfig(string configFile) { const string SYSTEM_LIB_KEY = "lib.system"; const string ADDITIONAL_LIB_KEY = "lib.additional"; var config = KeyValueConfig.Read(configFile); string sysDir = config[SYSTEM_LIB_KEY]; if (sysDir != null && !System.IO.Path.IsPathRooted(sysDir)) { var confDir = System.IO.Path.GetDirectoryName(configFile); sysDir = System.IO.Path.GetFullPath( System.IO.Path.Combine(confDir, sysDir)); } string additionalDirsList = config[ADDITIONAL_LIB_KEY]; string[] addDirs = null; if (additionalDirsList != null) { addDirs = additionalDirsList.Split(';'); } InitExternalLibraries(sysDir, addDirs); }
private void InitLibrariesFromConfig(KeyValueConfig config) { string sysDir = config[EngineConfigProvider.SYSTEM_LIB_KEY]; string additionalDirsList = config[EngineConfigProvider.ADDITIONAL_LIB_KEY]; string[] addDirs = null; if (additionalDirsList != null) { addDirs = additionalDirsList.Split(';'); } InitExternalLibraries(sysDir, addDirs); }
private void ReadDefaultConfig() { var defaultCfgPath = DefaultConfigFilePath(); if (defaultCfgPath != null) { var dict = ReadConfigFile(defaultCfgPath); _currentConfig = new KeyValueConfig(dict); } else { _currentConfig = new KeyValueConfig(new Dictionary <string, string>()); } }
private void InitLibraries(KeyValueConfig config) { if (_engine.DirectiveResolver != null) { return; } if (config != null) { InitLibrariesFromConfig(config); } else { InitExternalLibraries(null, null); } }
private void InitLibraries(KeyValueConfig config) { if (_librariesInitialized) { return; } if (config != null) { InitLibrariesFromConfig(config); } else { InitExternalLibraries(null, null); } }
public static KeyValueConfig Read(StreamReader reader) { var conf = new KeyValueConfig(); while (!reader.EndOfStream) { var line = reader.ReadLine(); if (String.IsNullOrWhiteSpace(line) || line[0] == '#') continue; var keyValue = line.Split(new[] { '=' }, 2); if (keyValue.Length != 2) continue; conf._values[keyValue[0].Trim()] = keyValue[1].Trim(); } return conf; }
public static KeyValueConfig Read(StreamReader reader) { var conf = new KeyValueConfig(); while (!reader.EndOfStream) { var line = reader.ReadLine(); if (String.IsNullOrWhiteSpace(line) || line[0] == '#') { continue; } var keyValue = line.Split(new[] { '=' }, 2); if (keyValue.Length != 2) { continue; } conf._values[keyValue[0].Trim()] = keyValue[1].Trim(); } return(conf); }