/// <summary>
    /// Fires when checkbox selection is changed.
    /// </summary>
    void checkBoxWithDropDown_OnCheckBoxSelectionChanged(object sender, EventArgs e)
    {
        var checkBoxWithDropDown = sender as CheckBoxWithDropDown;

        if (checkBoxWithDropDown != null)
        {
            if (checkBoxWithDropDown.CheckboxChecked)
            {
                if (checkBoxWithDropDown.DropDownVisible)
                {
                    SelectedCategories.Add(checkBoxWithDropDown.Value, VariantOptionInfo.ExistingUnselectedOption);
                }
                else
                {
                    SelectedCategories.Add(checkBoxWithDropDown.Value, VariantOptionInfo.NewOption);
                }
            }
            else
            {
                SelectedCategories.Remove(checkBoxWithDropDown.Value);
            }

            // Raise the SelectionChanged event
            if (OnSelectionChanged != null)
            {
                OnSelectionChanged(this, e);
            }
        }
    }
Ejemplo n.º 2
0
 public void DeselectCategory()
 {
     AvailableCategories.Add(SelectedUsedCategory);
     SelectedCategories.Remove(SelectedUsedCategory);
     SelectedUsedCategory = null;
 }