Exemple #1
0
        ContextMenuStrip CreateMenu(XGEffectBlockType type)
        {
            ContextMenuStrip   strip     = new ContextMenuStrip();
            EffectSelectorMenu container = new EffectSelectorMenu();

            strip.Items.Add(container);

            for (int i = 0; i < XGEffect.AllEffects.Count; i++)
            {
                XGEffect efct = XGEffect.AllEffects[i];
                if (type >= XGEffectBlockType.Variation ||
                    (type == XGEffectBlockType.Reverb && efct.SelectableForReverb) ||
                    (type == XGEffectBlockType.Chorus && efct.SelectableForChorus))
                {
                    container.AddButton(XGEffect.AllEffects[i].Name,
                                        XGEffect.AllEffects[i].Description,
                                        () => { strip.Close(); DecideEffect(type, efct); },
                                        efct.SelectableForReverb & efct.SelectableForChorus ? Color.DarkGray :
                                        efct.SelectableForReverb?Color.Maroon:
                                        efct.SelectableForChorus ? Color.Teal :
                                        Color.Navy
                                        );
                }
            }
            strip.LayoutStyle = ToolStripLayoutStyle.Flow;

            return(strip);
        }
        ContextMenuStrip CreateMenu(XGEffectBlockType type)
        {
            ContextMenuStrip strip = new ContextMenuStrip();
            EffectSelectorMenu container = new EffectSelectorMenu();
            strip.Items.Add(container);

            for (int i = 0; i < XGEffect.AllEffects.Count; i++)
            {
                XGEffect efct = XGEffect.AllEffects[i];
                if (type >= XGEffectBlockType.Variation
                    || (type == XGEffectBlockType.Reverb && efct.SelectableForReverb)
                    || (type == XGEffectBlockType.Chorus && efct.SelectableForChorus))
                {
                    container.AddButton(XGEffect.AllEffects[i].Name,
                        XGEffect.AllEffects[i].Description,
                        () => { strip.Close(); DecideEffect(type, efct); },
                        efct.SelectableForReverb & efct.SelectableForChorus ? Color.DarkGray :
                        efct.SelectableForReverb ? Color.Maroon :
                        efct.SelectableForChorus ? Color.Teal :
                        Color.Navy
                        );
                }
            }
            strip.LayoutStyle = ToolStripLayoutStyle.Flow;

            return strip;
        }