private List <string> ProcessConfig(ParsedModelConfig config, List <string> currentValue) { switch (config.ConfigurationType) { case JewelryModelConfigType.Options: var options = ((SelectorOptions)config.ConfigOptions).AllValues; return(CombineValues(currentValue, options)); case JewelryModelConfigType.Number: var option = ((NumberOptions)config.ConfigOptions).Min.ToString(CultureInfo.InvariantCulture); return(CombineValues(currentValue, new List <string> { option })); default: throw new ApplicationException($"Configuration type {config.ConfigurationType} is not supported!"); } }
public SpecificModelConfig( ParsedModelConfig modelConfig, string selectedItem) { _modelConfig = modelConfig; switch (modelConfig.ConfigurationType) { case JewelryModelConfigType.Number: SelectedItem = new NumberSelectedItem(selectedItem, (NumberOptions)modelConfig.ConfigOptions); break; case JewelryModelConfigType.Options: SelectedItem = new OptionsSelectedItem( selectedItem, (SelectorOptions)modelConfig.ConfigOptions); break; } }