Ejemplo n.º 1
0
    /// <summary>
    /// Find OptionCategorySelectionTypeEnum option which are not available for given option category type
    /// </summary>
    /// <param name="optionCategoryType">Currently selected category type in the form</param>
    private List <string> GetExcludedOptions(OptionCategoryTypeEnum optionCategoryType)
    {
        var excludedOptions = new List <string>();

        switch (optionCategoryType)
        {
        case OptionCategoryTypeEnum.Attribute:
            excludedOptions.Add(OptionCategorySelectionTypeEnum.TextArea.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.TextBox.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesHorizontal.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesVertical.ToStringRepresentation());

            break;

        case OptionCategoryTypeEnum.Products:
            excludedOptions.Add(OptionCategorySelectionTypeEnum.TextArea.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.TextBox.ToStringRepresentation());

            break;

        case OptionCategoryTypeEnum.Text:
            excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesHorizontal.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesVertical.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.Dropdownlist.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.RadioButtonsHorizontal.ToStringRepresentation());
            excludedOptions.Add(OptionCategorySelectionTypeEnum.RadioButtonsVertical.ToStringRepresentation());

            break;
        }

        return(excludedOptions);
    }
Ejemplo n.º 2
0
 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
     });
 }
 /// <summary>
 ///  Adds specific type of category to the list.
 /// </summary>
 /// <param name="categType">Category type</param>
 private void AddItem(OptionCategoryTypeEnum categType)
 {
     drpCategoryType.Items.Add(new ListItem(categType.ToLocalizedString("com.optioncategorytype"), categType.ToStringRepresentation()));
 }
 /// <summary>
 ///  Adds specific type of category to the list.
 /// </summary>
 /// <param name="resString">Category display name represented by the resource string</param>
 /// <param name="categType">Category type</param>
 private void AddItem(string resString, OptionCategoryTypeEnum categType)
 {
     drpTypes.Items.Add(new ListItem(GetString(resString), categType.ToStringRepresentation()));
 }
 /// <summary>
 ///  Adds specific type of category to the list.
 /// </summary>
 /// <param name="resString">Category display name represented by the resource string</param>
 /// <param name="categType">Category type</param>
 private void AddItem(string resString, OptionCategoryTypeEnum categType)
 {
     drpTypes.Items.Add(new ListItem(this.GetString(resString), OptionCategoryInfoProvider.GetOptionCategoryTypeString(categType)));
 }
Ejemplo n.º 6
0
 /// <summary>
 ///  Adds specific type of category to the list.
 /// </summary>
 /// <param name="resString">Category display name represented by the resource string</param>
 /// <param name="categType">Category type</param>
 private void AddItem(string resString, OptionCategoryTypeEnum categType)
 {
     drpTypes.Items.Add(new ListItem(this.GetString(resString), OptionCategoryInfoProvider.GetOptionCategoryTypeString(categType)));
 }
 /// <summary>
 ///  Adds specific type of category to the list.
 /// </summary>
 /// <param name="categType">Category type</param>
 private void AddItem(OptionCategoryTypeEnum categType)
 {
     drpCategoryType.Items.Add(new ListItem(categType.ToLocalizedString("com.optioncategorytype"), categType.ToStringRepresentation()));
 }
 /// <summary>
 ///  Adds specific type of category to the list.
 /// </summary>
 /// <param name="resString">Category display name represented by the resource string</param>
 /// <param name="categType">Category type</param>
 private void AddItem(string resString, OptionCategoryTypeEnum categType)
 {
     drpTypes.Items.Add(new ListItem(GetString(resString), categType.ToStringRepresentation()));
 }
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        // Option category type currently selected in the form
        OptionCategoryType = ValidationHelper.GetString(Form.FieldControls[OptionCategoryTypeColumn].Value, "").ToEnum<OptionCategoryTypeEnum>();

        if (OptionCategoryType != OriginalOptionCategoryType)
        {
            // Delete all options and fill drop down list according to the current category type
            drpSelectionTypeEnum.Items.Clear();
            ConfigureSelectionTypeControl();

            // Remember category type
            OriginalOptionCategoryType = OptionCategoryType;
        }
    }
    /// <summary>
    /// Find OptionCategorySelectionTypeEnum option which are not available for given option category type
    /// </summary>
    /// <param name="optionCategoryType">Currently selected category type in the form</param>
    private List<string> GetExcludedOptions(OptionCategoryTypeEnum optionCategoryType)
    {
        var excludedOptions = new List<string>();

        excludedOptions.Add(OptionCategorySelectionTypeEnum.FormControl.ToStringRepresentation());

        switch (optionCategoryType)
        {
            case OptionCategoryTypeEnum.Attribute:
                excludedOptions.Add(OptionCategorySelectionTypeEnum.TextArea.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.TextBox.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesHorizontal.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesVertical.ToStringRepresentation());

                break;

            case OptionCategoryTypeEnum.Products:
                excludedOptions.Add(OptionCategorySelectionTypeEnum.TextArea.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.TextBox.ToStringRepresentation());

                break;

            case OptionCategoryTypeEnum.Text:
                excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesHorizontal.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.CheckBoxesVertical.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.Dropdownlist.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.RadioButtonsHorizontal.ToStringRepresentation());
                excludedOptions.Add(OptionCategorySelectionTypeEnum.RadioButtonsVertical.ToStringRepresentation());

                break;
        }

        return excludedOptions;
    }