Beispiel #1
0
    /// <summary>
    /// Finds used selection control.
    /// </summary>
    /// <param name="selectionType"></param>
    private Control GetSelectionControl(OptionCategorySelectionTypeEnum selectionType)
    {
        switch (selectionType)
        {
        case OptionCategorySelectionTypeEnum.RadioButtonsHorizontal:
        case OptionCategorySelectionTypeEnum.RadioButtonsVertical:
            return(rblRadioButtons);

        case OptionCategorySelectionTypeEnum.CheckBoxesHorizontal:
        case OptionCategorySelectionTypeEnum.CheckBoxesVertical:
            return(chbCheckBoxes);

        case OptionCategorySelectionTypeEnum.TextBox:
        case OptionCategorySelectionTypeEnum.TextArea:
            return(txtText);

        default:
            return(ddlDropDown);
        }
    }
    /// <summary>
    /// Finds used selection control.
    /// </summary>
    /// <param name="selectionType"></param>
    private Control GetSelectionControl(OptionCategorySelectionTypeEnum selectionType)
    {
        switch (selectionType)
        {
            case OptionCategorySelectionTypeEnum.RadioButtonsHorizontal:
            case OptionCategorySelectionTypeEnum.RadioButtonsVertical:
                return rblRadioButtons;

            case OptionCategorySelectionTypeEnum.CheckBoxesHorizontal:
            case OptionCategorySelectionTypeEnum.CheckBoxesVertical:
                return chbCheckBoxes;

            case OptionCategorySelectionTypeEnum.TextBox:
            case OptionCategorySelectionTypeEnum.TextArea:
                return txtText;

            default:
                return ddlDropDown;
        }
    }
 public OptionCategoryInfo NewOptionCategory(string name, OptionCategoryTypeEnum type = OptionCategoryTypeEnum.Attribute, OptionCategorySelectionTypeEnum selectionType = OptionCategorySelectionTypeEnum.Dropdownlist)
 {
     return(new OptionCategoryInfo
     {
         CategoryName = NewUniqueName(),
         CategoryEnabled = true,
         CategorySelectionType = selectionType,
         CategoryDisplayName = name,
         CategoryType = type,
         CategorySiteID = SiteInfo.SiteID
     });
 }