Inheritance: System.Windows.Forms.Panel
 /// <summary>
 /// Arranges slots in the layout.
 /// </summary>
 private void ArrangeTop10Slots()
 {
     FlowLayoutStrategy.SuspendLayout();
     FlowLayoutStrategy.Controls.Clear();
     foreach (var keyValue in _top10Holder)
     {
         Top10Slot top10Slot = keyValue.Value.Top10Slot;
         top10Slot.Width  = ClientSize.Width - VScrollBarStrategy.Width - 2 * Space;
         top10Slot.Margin = new Padding(Space, Space, 0, 0);
         top10Slot.Cursor = Cursors.Hand;
         _toolTip.SetToolTip(top10Slot, Language.T("Activate the strategy."));
         FlowLayoutStrategy.Controls.Add(top10Slot);
     }
     FlowLayoutStrategy.ResumeLayout();
 }
Exemple #2
0
 /// <summary>
 /// Arranges slots in the layout.
 /// </summary>
 void ArrangeTop10Slots()
 {
     flowLayoutStrategy.SuspendLayout();
     flowLayoutStrategy.Controls.Clear();
     foreach (KeyValuePair <int, Top10StrategyInfo> keyValue in top10Holder)
     {
         Top10Slot top10Slot = keyValue.Value.Top10Slot;
         top10Slot.Width  = ClientSize.Width - VScrollBarStrategy.Width - 2 * margin;
         top10Slot.Margin = new Padding(margin, margin, 0, 0);
         top10Slot.Cursor = Cursors.Hand;
         toolTip.SetToolTip(top10Slot, Language.T("Activate the strategy."));
         flowLayoutStrategy.Controls.Add(top10Slot);
     }
     flowLayoutStrategy.ResumeLayout();
 }
 /// <summary>
 /// Adds a strategy to Top 10 list.
 /// </summary>
 void Top10AddStrategy()
 {
     if (top10Layout.InvokeRequired)
     {
         Invoke(new DelegateTop10AddStrategy(Top10AddStrategy), new object[] { });
     }
     else
     {
         Top10Slot top10Slot = new Top10Slot();
         top10Slot.Width  = 290;
         top10Slot.Height = 65;
         top10Slot.InitSlot();
         top10Slot.Click       += new EventHandler(Top10Slot_Click);
         top10Slot.DoubleClick += new EventHandler(Top10Slot_Click);
         Top10StrategyInfo top10StrategyInfo = new Top10StrategyInfo();
         top10StrategyInfo.Balance     = Configs.AccountInMoney ? (int)Math.Round(Backtester.NetMoneyBalance) : Backtester.NetBalance;
         top10StrategyInfo.Top10Slot   = top10Slot;
         top10StrategyInfo.TheStrategy = Data.Strategy.Clone();
         top10Layout.AddStrategyInfo(top10StrategyInfo);
     }
 }
 /// <summary>
 /// Adds a strategy to Top 10 list.
 /// </summary>
 private void Top10AddStrategy()
 {
     if (Top10Field.InvokeRequired)
     {
         Invoke(new DelegateTop10AddStrategy(Top10AddStrategy), new object[] {});
     }
     else
     {
         var top10Slot = new Top10Slot {Width = 290, Height = 65};
         top10Slot.InitSlot();
         top10Slot.Click += Top10SlotClick;
         top10Slot.DoubleClick += Top10SlotClick;
         var top10StrategyInfo = new Top10StrategyInfo
                                     {
                                         Balance = Configs.AccountInMoney
                                                       ? (int) Math.Round(Backtester.NetMoneyBalance)
                                                       : Backtester.NetBalance,
                                         Top10Slot = top10Slot,
                                         TheStrategy = Data.Strategy.Clone()
                                     };
         Top10Field.AddStrategyInfo(top10StrategyInfo);
     }
 }