Exemplo n.º 1
0
        public Config(SerializationInfo info, StreamingContext context) : base(null)
        {
            var config = HoconConfigurationFactory.ParseString(info.GetValue(SerializedPropertyName, typeof(string)) as string);

            Value = config.Value;
            _fallbacks.AddRange(config._fallbacks);
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Adds the supplied configuration as a fallback to the supplied configuration string.
 /// </summary>
 /// <param name="configHocon">The configuration string used as the source.</param>
 /// <param name="fallbackConfig">The configuration used as the fallback.</param>
 /// <returns>A configuration configured with the supplied fallback.</returns>
 public static Config operator +(string configHocon, Config fallbackConfig)
 {
     return(HoconConfigurationFactory.ParseString(configHocon).WithFallback(fallbackConfig));
 }
Exemplo n.º 3
0
 /// <summary>
 ///     Adds the supplied configuration string as a fallback to the supplied configuration.
 /// </summary>
 /// <param name="config">The configuration used as the source.</param>
 /// <param name="fallback">The string used as the fallback configuration.</param>
 /// <returns>The supplied configuration configured with the supplied fallback.</returns>
 public static Config operator +(Config config, string fallback)
 {
     return(config.WithFallback(HoconConfigurationFactory.ParseString(fallback)));
 }