public virtual void attachChoice(QuestionDef q) { if (q.DynamicChoices != null) { //can't attach dynamic choices because they aren't guaranteed to exist yet return; } SelectChoice choice = null; if (index != -1 && index < q.NumChoices) { choice = q.getChoice(index); } else if (xmlValue != null && xmlValue.Length > 0) { choice = q.getChoiceForValue(xmlValue); } if (choice != null) { attachChoice(choice); } else { throw new XPathTypeMismatchException("value " + xmlValue + " could not be loaded into question " + q.TextID + ". Check to see if value " + xmlValue + " is a valid option for question " + q.TextID + "."); } }
private static Selection getSelection(System.String choiceValue, QuestionDef q) { Selection s; if (q == null || q.DynamicChoices != null) { s = new Selection(choiceValue); } else { SelectChoice choice = q.getChoiceForValue(choiceValue); s = (choice != null?choice.selection():null); } return(s); }
public virtual void attachChoice(SelectChoice choice) { this.choice = choice; this.xmlValue = choice.Value; this.index = choice.Index; }
public Selection(SelectChoice choice) { attachChoice(choice); }
public virtual System.String getSpecialFormSelectChoiceText(SelectChoice sel, System.String form) { return(getSpecialFormSelectItemText(sel.selection(), form)); }
/// <seealso cref="getSelectItemText(Selection sel)"> /// </seealso> public virtual System.String getSelectChoiceText(SelectChoice selection) { return(getSelectItemText(selection.selection())); }