public BuySellEntry(TTSFormState state) : base(state) { this.InitializeComponent(); OrderEntryPanel orderEntryPanel = new OrderEntryPanel(true); OrderEntryPanel expr_17 = orderEntryPanel; expr_17.AddOrderEntryPanelClick = (Action)System.Delegate.Combine(expr_17.AddOrderEntryPanelClick, delegate { this.AddOrderEntryPanel(); }); this.OrderEntryPanelTableLayout.Controls.Add(orderEntryPanel); if (state != null && state.State != null) { try { Tuple<bool, bool, decimal, string, decimal>[] array = (Tuple<bool, bool, decimal, string, decimal>[])state.State; for (int i = 0; i < array.Length; i++) { if (i > 0) { orderEntryPanel = this.AddOrderEntryPanel(); } orderEntryPanel.SetState(array[i]); } } catch { } } }
private OrderEntryPanel AddOrderEntryPanel() { OrderEntryPanel orderEntryPanel = new OrderEntryPanel(false); OrderEntryPanel expr_08 = orderEntryPanel; expr_08.RemoveOrderEntryPanelClick = (System.Action<OrderEntryPanel>)System.Delegate.Combine(expr_08.RemoveOrderEntryPanelClick, delegate(OrderEntryPanel sender) { int row = this.OrderEntryPanelTableLayout.GetRow(sender); this.OrderEntryPanelTableLayout.Controls.Remove(sender); for (int i = row; i < this.OrderEntryPanelTableLayout.Controls.Count; i++) { this.OrderEntryPanelTableLayout.SetRow(this.OrderEntryPanelTableLayout.Controls[i], i); } this.OrderEntryPanelTableLayout.RowCount = this.OrderEntryPanelTableLayout.Controls.Count; }); this.OrderEntryPanelTableLayout.RowCount++; this.OrderEntryPanelTableLayout.Controls.Add(orderEntryPanel, 0, this.OrderEntryPanelTableLayout.RowCount - 1); return orderEntryPanel; }