Forex_Strategy_Builder.Dialogs.Generator.Generator.RebuildStrategyLayout C# (CSharp) Method

RebuildStrategyLayout() private method

Creates a new strategy layout according to the given strategy.
private RebuildStrategyLayout ( Strategy strategy ) : void
strategy Strategy
return void
        void RebuildStrategyLayout(Strategy strategy)
        {
            if (strategyLayout.InvokeRequired)
            {
                Invoke(new DelegateRebuildStrategyLayout(RebuildStrategyLayout), new object[] { strategy });
            }
            else
            {
                strategyLayout.RebuildStrategyControls(strategy);
                strategyLayout.pnlProperties.Click       += new EventHandler(PnlProperties_Click);
                strategyLayout.pnlProperties.DoubleClick += new EventHandler(PnlProperties_Click);
                for (int slot = 0; slot < strategy.Slots; slot++)
                {
                    strategyLayout.apnlSlot[slot].Click       += new EventHandler(PnlSlot_Click);
                    strategyLayout.apnlSlot[slot].DoubleClick += new EventHandler(PnlSlot_Click);
                }
            }

            return;
        }