コード例 #1
0
 /// <summary>
 /// Returns the value for the specified setting, or the supplied
 /// default if the setting does not exist
 /// </summary>
 public string GetSetting(string key, string defaultValue)
 {
     if (!AggregateProperties.TryGetValue(key, out var value))
     {
         value = defaultValue;
     }
     return(value);
 }
コード例 #2
0
 /// <summary>
 /// Returns the value for the specified setting.
 /// Throws if the setting does not exist.
 /// </summary>
 public string GetSetting(string key)
 {
     if (!AggregateProperties.TryGetValue(key, out var value))
     {
         var message = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.ERROR_MissingSetting, key);
         throw new InvalidOperationException(message);
     }
     return(value);
 }
コード例 #3
0
 public IEnumerable <Property> GetAllProperties()
 {
     return(AggregateProperties.GetAllProperties());
 }
コード例 #4
0
 public bool TryGetSetting(string key, out string value)
 {
     return(AggregateProperties.TryGetValue(key, out value));
 }