private bool tryResolveSelection(string optionName, TemplateChoices choices)
        {
            OptionSelection selection = (this.Selections ?? ((IList <OptionSelection>) new OptionSelection[0])).FirstOrDefault((OptionSelection x) => x.FindOption(optionName) != null);

            if (selection == null)
            {
                return(false);
            }
            choices.Selections.Fill(selection.Name, optionName);
            return(true);
        }
Exemple #2
0
        public static OptionSelection BuildSelection(this XmlElement selectionElement)
        {
            OptionSelection selection = new OptionSelection
            {
                Name        = selectionElement.GetAttribute("name"),
                Description = selectionElement.GetAttribute("description")
            };

            selection.Options = selectionElement.ReadOptions();
            return(selection);
        }