Ejemplo n.º 1
0
        public static DynamiConfiguration EnvironmentVars(this InterpreterSources provider, params string[] vars)
        {
            var conf = new Configuration();

            foreach (var @var in vars)
            {
                conf[@var] = Environment.GetEnvironmentVariable(@var);
            }

            provider.RegisterConfiguration(conf);

            return(provider.Configuration);
        }
Ejemplo n.º 2
0
        public static DynamiConfiguration AppSettings(this InterpreterSources provider, string prefix = "")
        {
            var conf = new Configuration();

            foreach (var key in ConfigurationManager.AppSettings.AllKeys.Where(key => key.StartsWith(prefix)))
            {
                conf[key] = ConfigurationManager.AppSettings[key];
            }

            provider.RegisterConfiguration(conf);

            return(provider.Configuration);
        }
Ejemplo n.º 3
0
 public static LocationFinder IniFormat(this InterpreterSources sources)
 {
     return(new LocationFinder(sources, new IniFormatParserConfigurationInterpreter()));
 }
Ejemplo n.º 4
0
 public LocationSources(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     _sources      = sources;
     Interpreter   = configurationInterpreter;
     Configuration = sources.Configuration;
 }
Ejemplo n.º 5
0
 public LocationSources(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     _sources = sources;
     Interpreter = configurationInterpreter;
     Configuration = sources.Configuration;
 }
Ejemplo n.º 6
0
 public static DynamiConfiguration ExpandoObject(this InterpreterSources provider, ExpandoObject obj)
 {
     provider.RegisterConfiguration(ExpandoObject2Configuration.Transform(obj));
     return(provider.Configuration);
 }
Ejemplo n.º 7
0
 public LocationFinder(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     From = new LocationSources(sources, configurationInterpreter);
 }
Ejemplo n.º 8
0
 public LocationFinder(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     From = new LocationSources(sources, configurationInterpreter);
 }
Ejemplo n.º 9
0
 // Esta clase construye un objeto configuration
 public DynamiConfiguration()
 {
     MergeWith          = new InterpreterSources(this);
     FinalConfiguration = new Configuration();
 }
Ejemplo n.º 10
0
 public static LocationFinder Json(this InterpreterSources sources)
 {
     return(new LocationFinder(sources, new JsonNetConfigurationInterpreter()));
 }
Ejemplo n.º 11
0
 public static LocationFinder Json(this InterpreterSources sources, JsonSerializerSettings settings)
 {
     return(new LocationFinder(sources, new JsonNetConfigurationInterpreter(settings)));
 }