예제 #1
0
 private static void AddDefaultValueIfKnown(List <object> environmentValuesMapping,
                                            ConfigurationParameter parameter)
 {
     if (!ConfigurationParameter.IsValueUnknown(parameter.DefaultValue))
     {
         environmentValuesMapping.Add(new Dictionary <string, string>
         {
             { "default", parameter.DefaultValue }
         });
     }
 }
예제 #2
0
            private static bool IsEnvironmentValueSameAsDefault(
                ConfigurationParameter parameter, ConfigurableEnvironment environment,
                out string environmentValue)
            {
                var isEnvironmentValueDefined = parameter.Values.TryGetValue(environment, out environmentValue);

                if (!isEnvironmentValueDefined && ConfigurationParameter.IsValueUnknown(parameter.DefaultValue) ||
                    isEnvironmentValueDefined &&
                    ((ConfigurationParameter.IsValueUnknown(environmentValue) &&
                      ConfigurationParameter.IsValueUnknown(parameter.DefaultValue)) ||
                     environmentValue == parameter.DefaultValue))
                {
                    return(true);
                }

                return(false);
            }
예제 #3
0
 private static bool AreAllParamValuesUnknownAndDefaultValueIsAlsoUnknown(
     ConfigurationParameter parameter)
 {
     return(parameter.Values.All(v => ConfigurationParameter.IsValueUnknown(v.Value)) &&
            ConfigurationParameter.IsValueUnknown(parameter.DefaultValue));
 }