コード例 #1
0
 /// <summary>
 /// Create a new StartContext with the given options.
 /// If the given options do not define any settings, then settings will be loaded from the config.
 /// </summary>
 /// <param name="options"></param>
 public StartContext(StartOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     SettingsLoader.LoadFromConfig(options.Settings);
     Options         = options;
     EnvironmentData = new List <KeyValuePair <string, object> >();
 }
コード例 #2
0
        public void LoadSettingsFromConfig_CaseInsensitive()
        {
            IDictionary <string, string> settings = SettingsLoader.LoadFromConfig();
            string value;

            Assert.True(settings.TryGetValue("UpperCase", out value));
            Assert.True(string.Equals("UpperCaseValue", value, StringComparison.Ordinal));

            Assert.True(settings.TryGetValue("uppercase", out value));
            Assert.True(string.Equals("UpperCaseValue", value, StringComparison.Ordinal));
        }
コード例 #3
0
        public void LoadOptionsFromConfig_CaseInsensitive()
        {
            var options = new StartOptions();

            SettingsLoader.LoadFromConfig(options.Settings);
            IDictionary <string, string> settings = options.Settings;
            string value;

            Assert.True(settings.TryGetValue("UpperCase", out value));
            Assert.True(string.Equals("UpperCaseValue", value, StringComparison.Ordinal));

            Assert.True(settings.TryGetValue("uppercase", out value));
            Assert.True(string.Equals("UpperCaseValue", value, StringComparison.Ordinal));
        }
コード例 #4
0
ファイル: ServicesFactory.cs プロジェクト: evicertia/Katana
 /// <summary>
 /// Create a default ServiceProvider.
 /// </summary>
 /// <param name="configuration"></param>
 /// <returns></returns>
 public static IServiceProvider Create(Action <ServiceProvider> configuration)
 {
     return(Create(SettingsLoader.LoadFromConfig(), configuration));
 }
コード例 #5
0
ファイル: ServicesFactory.cs プロジェクト: evicertia/Katana
 /// <summary>
 /// Enumerate the default service types.
 /// </summary>
 /// <param name="callback"></param>
 public static void ForEach(Action <Type, Type> callback)
 {
     DoCallback(SettingsLoader.LoadFromConfig(), callback);
 }