Forex_Strategy_Builder.Dialogs.Generator.IndicatorsLayout.ChbxIndicator_CheckedChanged C# (CSharp) Method

ChbxIndicator_CheckedChanged() private method

Change of the indicator ban state.
private ChbxIndicator_CheckedChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        void ChbxIndicator_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox chbxIndicator = (CheckBox)sender;
            bool isBanned = !chbxIndicator.Checked;
            string indicatorName = chbxIndicator.Text;

            if (currentSlotType == SlotTypes.Open)
            {
                if (isBanned)
                {
                    if (!bannedEntryIndicators.Contains(indicatorName))
                        bannedEntryIndicators.Add(indicatorName);
                }
                else
                {
                    if (bannedEntryIndicators.Contains(indicatorName))
                        bannedEntryIndicators.Remove(indicatorName);
                }
            }
            else if (currentSlotType == SlotTypes.OpenFilter)
            {
                if (isBanned)
                {
                    if (!bannedEntryFilterIndicators.Contains(indicatorName))
                        bannedEntryFilterIndicators.Add(indicatorName);
                }
                else
                {
                    if (bannedEntryFilterIndicators.Contains(indicatorName))
                        bannedEntryFilterIndicators.Remove(indicatorName);
                }
            }
            else if (currentSlotType == SlotTypes.Close)
            {
                if (isBanned)
                {
                    if (!bannedExitIndicators.Contains(indicatorName))
                        bannedExitIndicators.Add(indicatorName);
                }
                else
                {
                    if (bannedExitIndicators.Contains(indicatorName))
                        bannedExitIndicators.Remove(indicatorName);
                }
            }
            else if (currentSlotType == SlotTypes.CloseFilter)
            {
                if (isBanned)
                {
                    if (!bannedExitFilterIndicators.Contains(indicatorName))
                        bannedExitFilterIndicators.Add(indicatorName);
                }
                else
                {
                    if (bannedExitFilterIndicators.Contains(indicatorName))
                        bannedExitFilterIndicators.Remove(indicatorName);
                }
            }

            SetStatusButton();
            vScrollBar.Select();
        }