예제 #1
0
        void AddAccountControl(Account account)
        {
            AccountControl control = new AccountControl();

            control.Account = account;
            _accountControls.Add(control);
            this.Controls.Add(control);
        }
        Panel CreateSessionPanel(PlatformExpertSession session)
        {
            Panel panel = new Panel();

            // Session not found, create new button for it.
            PlatformExpertSessionControl sessionChartControl = new PlatformExpertSessionControl();

            sessionChartControl.Dock = DockStyle.Fill;
            sessionChartControl.CreateControl();
            sessionChartControl.Session = session;

            panel.Controls.Add(sessionChartControl);

            if (session.OrderExecutionProvider != null)
            {
                Splitter splitter = new SplitterEx();
                splitter.Dock = DockStyle.Bottom;
                panel.Controls.Add(splitter);
                splitter.Height = 6;

                OrdersControl ordersControl = new OrdersControl();
                ordersControl.Dock = DockStyle.Bottom;
                ordersControl.CreateControl();
                ordersControl.SingleSession   = session;
                ordersControl.VisibleChanged += delegate(object sender, EventArgs e)
                {
                    splitter.Visible = ordersControl.Visible;
                };
                //ordersControl.Manager = this._expert.Manager;
                panel.Controls.Add(ordersControl);

                sessionChartControl.CorrespondingOrdersControl = ordersControl;

                Splitter splitter2 = new Splitter();
                splitter2.Dock = DockStyle.Bottom;
                panel.Controls.Add(splitter2);

                AccountControl accountControl = new AccountControl();
                accountControl.Dock = DockStyle.Bottom;
                accountControl.CreateControl();
                accountControl.Account = session.OrderExecutionProvider.DefaultAccount;
                panel.Controls.Add(accountControl);
            }

            panel.Tag = sessionChartControl;

            panel.Visible = false;
            panel.Dock    = DockStyle.Fill;

            return(panel);
        }
 void RemoveAccountControl(AccountControl control)
 {
     control.Account = null;
     _accountControls.Remove(control);
     this.Controls.Remove(control);
 }
 void AddAccountControl(Account account)
 {
     AccountControl control = new AccountControl();
     control.Account = account;
     _accountControls.Add(control);
     this.Controls.Add(control);
 }
        Panel CreateSessionPanel(PlatformExpertSession session)
        {
            Panel panel = new Panel();

            // Session not found, create new button for it.
            PlatformExpertSessionControl sessionChartControl = new PlatformExpertSessionControl();
            sessionChartControl.Dock = DockStyle.Fill;
            sessionChartControl.CreateControl();
            sessionChartControl.Session = session;

            panel.Controls.Add(sessionChartControl);

            if (session.OrderExecutionProvider != null)
            {
                Splitter splitter = new SplitterEx();
                splitter.Dock = DockStyle.Bottom;
                panel.Controls.Add(splitter);
                splitter.Height = 6;

                OrdersControl ordersControl = new OrdersControl();
                ordersControl.Dock = DockStyle.Bottom;
                ordersControl.CreateControl();
                ordersControl.SingleSession = session;
                ordersControl.VisibleChanged += delegate(object sender, EventArgs e)
                {
                    splitter.Visible = ordersControl.Visible;
                };
                //ordersControl.Manager = this._expert.Manager;
                panel.Controls.Add(ordersControl);

                sessionChartControl.CorrespondingOrdersControl = ordersControl;

                Splitter splitter2 = new Splitter();
                splitter2.Dock = DockStyle.Bottom;
                panel.Controls.Add(splitter2);

                AccountControl accountControl = new AccountControl();
                accountControl.Dock = DockStyle.Bottom;
                accountControl.CreateControl();
                accountControl.Account = session.OrderExecutionProvider.DefaultAccount;
                panel.Controls.Add(accountControl);
            }

            panel.Tag = sessionChartControl;

            panel.Visible = false;
            panel.Dock = DockStyle.Fill;

            return panel;
        }
예제 #6
0
 void RemoveAccountControl(AccountControl control)
 {
     control.Account = null;
     _accountControls.Remove(control);
     this.Controls.Remove(control);
 }