Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();

            //looping thru companies
            foreach (Company comp in RTD._company)
            {
                //make the drop down list with all the companies
                ToolStripMenuItem biteme = new ToolStripMenuItem();
                biteme.Text = comp.compName;
                biteme.Name = "foo";

                ToolStripMenuItem eatme = new ToolStripMenuItem();
                eatme.Text = comp.compName;
                eatme.Name = "boo";

                biteme.Click += new EventHandler(delegate
                {    //create the appropriate form
                    MarketDepthByOrder MarketByOrder = new MarketDepthByOrder(this.RTD, comp);
                    // Set the parent form of the child window.
                    MarketByOrder.MdiParent = this;
                    // Display the new form.
                    MarketByOrder.Show();
                    MarketByOrder.Update(this.RTD);
                    //register the view
                    RTD.Register(MarketByOrder);
                }
                                                 );
                eatme.Click += new EventHandler(delegate
                {
                    MarketDepthByPrice MarketByPrice = new MarketDepthByPrice(this.RTD, comp);
                    // Set the parent form of the child window.
                    MarketByPrice.MdiParent = this;
                    // Display the new form.
                    MarketByPrice.Show();
                    MarketByPrice.Update(this.RTD);

                    //register the view
                    RTD.Register(MarketByPrice);
                });

                //add the forms to the drop down
                marketByOrderToolStripMenuItem.DropDownItems.Add(biteme);
                marketByPriceToolStripMenuItem.DropDownItems.Add(eatme);
            }

            //make a state summary form

            StateSummary StockStateSummary = new StateSummary(this.RTD);

            //register the obserer
            RTD.Register(StockStateSummary);
        }
Esempio n. 2
0
        public MainForm()
        {
            InitializeComponent();

            //looping thru companies
            foreach (Company comp in RTD._company)
            {
                //make the drop down list with all the companies
                ToolStripMenuItem biteme = new ToolStripMenuItem();
                biteme.Text = comp.compName;
                biteme.Name = "foo";

                ToolStripMenuItem eatme = new ToolStripMenuItem();
                eatme.Text = comp.compName;
                eatme.Name = "boo";

                biteme.Click += new EventHandler(delegate
                    {//create the appropriate form
                        MarketDepthByOrder MarketByOrder = new MarketDepthByOrder(this.RTD, comp);
                        // Set the parent form of the child window.
                        MarketByOrder.MdiParent = this;
                        // Display the new form.
                        MarketByOrder.Show();
                        MarketByOrder.Update(this.RTD);
                        //register the view
                        RTD.Register(MarketByOrder);
                    }
                    );
                eatme.Click += new EventHandler(delegate
                    {
                        MarketDepthByPrice MarketByPrice = new MarketDepthByPrice(this.RTD,comp);
                        // Set the parent form of the child window.
                        MarketByPrice.MdiParent = this;
                        // Display the new form.
                        MarketByPrice.Show();
                        MarketByPrice.Update(this.RTD);

                        //register the view
                        RTD.Register(MarketByPrice);
                    });

                //add the forms to the drop down
                marketByOrderToolStripMenuItem.DropDownItems.Add(biteme);
                marketByPriceToolStripMenuItem.DropDownItems.Add(eatme);

            }

            //make a state summary form

            StateSummary StockStateSummary = new StateSummary(this.RTD);
               //register the obserer
            RTD.Register(StockStateSummary);
        }