GetSettingsStartingWith() public méthode

public GetSettingsStartingWith ( string setting ) : OpenIDE.Core.Config.ConfigurationSetting[]
setting string
Résultat OpenIDE.Core.Config.ConfigurationSetting[]
Exemple #1
0
        private void readInterpreters(Configuration config)
        {
            var prefix = "interpreter.";
            foreach (var interpreter in config.GetSettingsStartingWith(prefix)) {
                if (interpreter.Key.Length <= prefix.Length)
                    continue;

                var extension =
                    interpreter.Key
                        .Substring(
                            prefix.Length,
                             interpreter.Key.Length - prefix.Length);
                if (extension.Length == 0)
                    continue;

                extension = "." + extension;
                var path = interpreter.Value;
                if (Environment.OSVersion.Platform != PlatformID.Unix &&
                    Environment.OSVersion.Platform != PlatformID.MacOSX) {
                    path.Replace("/", "\\");
                }
                if (!File.Exists(path)) {
                    path =
                        System.IO.Path.Combine(
                            System.IO.Path.GetDirectoryName(
                                Assembly.GetExecutingAssembly().Location),
                            path);
                    if (!File.Exists(path))
                        continue;
                }
                if (!_interpreters.ContainsKey(extension))
                    _interpreters.Add(extension, path);
            }
        }
Exemple #2
0
 private void valuesFromConfig(string path, string name, List<ConfigurationSetting> results)
 {
     var cfg = new Configuration(path, false);
     cfg.GetSettingsStartingWith(name).ToList()
         .ForEach(x => {
                 if (!results.Any(y => y.Key == x.Key))
                     results.Add(x);
             });
 }
 private void valuesFromConfig(string path, string name, List<ConfigurationSetting> results)
 {
     if (path == null)
         return;
     var cfgfile = Path.Combine(path, "oi.config");
     var cfg = new Configuration(cfgfile, false);
     cfg.GetSettingsStartingWith(name).ToList()
         .ForEach(x => {
                 if (!results.Any(y => y.Key == x.Key))
                     results.Add(x);
             });
 }