internal static SettingDictionary ParametersToSettings([CanBeNull] RuntimeDefinedParameterDictionary parameters) { if (parameters == null) { return(null); } var result = new SettingDictionary(); foreach (var parameter in parameters.Where(p => p.Value.IsSet)) { result.Add(parameter.Key, parameter.Value.ParameterType == typeof(SwitchParameter) ? true : parameter.Value.Value); } return(result); }