Ejemplo n.º 1
0
        public RealTimeData realdata; //store the realdata yo

        #endregion Fields

        #region Constructors

        public PlaceBid(RealTimeData r)
        {
            InitializeComponent();
            realdata = r; //passed in through mainform. has list of companies
            foreach (Company value in realdata._company)
            {
                comboBox1.Items.Add(value.compName);
            }
        }
Ejemplo n.º 2
0
 public PlaceSell(RealTimeData r)
 {
     InitializeComponent();
     realdata = r; //passed in through mainform. has list of companies
     foreach (Company value in realdata._company)
     {
         comboBox1.Items.Add(value.compName);
     }
 }
Ejemplo n.º 3
0
        public MarketDepthByPrice(RealTimeData RTD, Company comp)
        {
            InitializeComponent();
            this.comp = comp; //the current compnay for this window
            this.Text += " " + comp.compName; //set the text at the top of the form
            Update(RTD); //add any data from the data model to the view
            realdata = RTD; //store a copy of the data model

            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(delegate
            {
                realdata.unRegister(this);
            });
        }
Ejemplo n.º 4
0
 public void Update(RealTimeData s)
 {
     realdata = s;
     Console.Write("updatingggggggggggggggggggggggggggggggg");
     //setting the values
     dataGridView1.Rows[0].SetValues(realdata._company[0].compName, "PAPA", realdata._company[0].openingPrice, realdata._company[0].lastPrice, realdata._company[0].NetChange, null, realdata._company[0].percentageChange, realdata._company[0].VolumeOfShare);
     dataGridView1.Rows[1].SetValues(realdata._company[1].compName, "PAPA", realdata._company[1].openingPrice, realdata._company[1].lastPrice, realdata._company[1].NetChange, null, realdata._company[1].percentageChange, realdata._company[1].VolumeOfShare);
     dataGridView1.Rows[2].SetValues(realdata._company[2].compName, "PAPA", realdata._company[2].openingPrice, realdata._company[2].lastPrice, realdata._company[2].NetChange, null, realdata._company[2].percentageChange, realdata._company[2].VolumeOfShare);
     //puts images in the 5th column
     dataGridView1[5, 0].Value = realdata._company[0].image;
     dataGridView1[5, 1].Value = realdata._company[1].image;
     dataGridView1[5, 2].Value = realdata._company[2].image;
 }
Ejemplo n.º 5
0
        //this.Update(s);
        public StateSummary(RealTimeData rdata)
        {
            InitializeComponent();

            dataGridView1.Rows.Add(2);

            this.realdata    = rdata;
            this.companyName = rdata._company[0].compName;

            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(delegate {
                realdata.unRegister(this);
            });
        }
Ejemplo n.º 6
0
 public void Update(RealTimeData s)
 {
     realdata = s;
     Console.Write("updatingggggggggggggggggggggggggggggggg");
     //setting the values
     dataGridView1.Rows[0].SetValues(realdata._company[0].compName, "PAPA", realdata._company[0].openingPrice, realdata._company[0].lastPrice, realdata._company[0].NetChange, null, realdata._company[0].percentageChange, realdata._company[0].VolumeOfShare);
     dataGridView1.Rows[1].SetValues(realdata._company[1].compName, "PAPA", realdata._company[1].openingPrice, realdata._company[1].lastPrice, realdata._company[1].NetChange, null, realdata._company[1].percentageChange, realdata._company[1].VolumeOfShare);
     dataGridView1.Rows[2].SetValues(realdata._company[2].compName, "PAPA", realdata._company[2].openingPrice, realdata._company[2].lastPrice, realdata._company[2].NetChange, null, realdata._company[2].percentageChange, realdata._company[2].VolumeOfShare);
        //puts images in the 5th column
     dataGridView1[5, 0].Value = realdata._company[0].image;
     dataGridView1[5, 1].Value = realdata._company[1].image;
     dataGridView1[5, 2].Value = realdata._company[2].image;
 }
Ejemplo n.º 7
0
        //this.Update(s);
        public StateSummary(RealTimeData rdata)
        {
            InitializeComponent();

            dataGridView1.Rows.Add(2);

            this.realdata = rdata;
            this.companyName = rdata._company[0].compName;

            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(delegate {
                realdata.unRegister(this);
            });
        }
Ejemplo n.º 8
0
        //CONSTRUCTORS======================
        public MarketDepthByOrder(RealTimeData RTD, Company comp)
        {
            //some image stuff
            InitializeComponent();
            this.comp = comp;
            this.Text += " " + comp.compName;
            Update(realdata);
            realdata = RTD;

            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(delegate
            {
                realdata.unRegister(this);
            });
        }
Ejemplo n.º 9
0
        public MarketDepthByPrice(RealTimeData RTD, Company comp)
        {
            InitializeComponent();
            this.comp  = comp;                //the current compnay for this window
            this.Text += " " + comp.compName; //set the text at the top of the form
            Update(RTD);                      //add any data from the data model to the view
            realdata = RTD;                   //store a copy of the data model


            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(delegate
            {
                realdata.unRegister(this);
            });
        }
Ejemplo n.º 10
0
        public void Update(RealTimeData s)
        {
            List<BuyOrder> buylist = new List<BuyOrder>();
                int i = 0;
                foreach (BuyOrder value in comp.Buyorder)
                {
                    if (i < 10)
                        buylist.Add(value);
                    i++;
                }
                realdata = s;
                dataGridView1.Rows.Clear();
                IEnumerable<IGrouping<float, BuyOrder>> collection = buylist.GroupBy(b => b.orderPrice).OrderBy(b => b.Key).Reverse();

                foreach (IGrouping<float, BuyOrder> orders in collection)
                {

                    int vol = 0;

                    //go through each buyorder
                    foreach (BuyOrder buyo in orders)
                    {
                        vol += buyo.orderSize;
                        //pocket full of mumbles
                        dataGridView1.Rows.Add(orders.Count(), vol, orders.Key);//orders.count() is how many times that order was made

                    }

                }

                IEnumerable<IGrouping<float, BuyOrder>> collection2 = buylist.GroupBy(b => b.orderPrice).OrderBy(b => b.Key).Reverse();

                dataGridView2.Rows.Clear();
                foreach (IGrouping<float, BuyOrder> orders2 in collection2)
                {

                    int vol = 0;

                    //go through each buyorder
                    foreach (BuyOrder buyo in orders2)
                    {
                        vol += buyo.orderSize;
                        //pocket full of mumbles
                        dataGridView2.Rows.Add(orders2.Count(),vol, orders2.Key);//orders.count() is how many times that order was made

                    }

                }
        }
Ejemplo n.º 11
0
        //CONSTRUCTORS======================
        public MarketDepthByOrder(RealTimeData RTD, Company comp)
        {
            //some image stuff
            InitializeComponent();
            this.comp  = comp;
            this.Text += " " + comp.compName;
            Update(realdata);
            realdata = RTD;


            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(delegate
            {
                realdata.unRegister(this);
            });
        }
Ejemplo n.º 12
0
        public void Update(RealTimeData s)
        {
            List <BuyOrder> buylist = new List <BuyOrder>();
            int             i       = 0;

            foreach (BuyOrder value in comp.Buyorder)
            {
                if (i < 10)
                {
                    buylist.Add(value);
                }
                i++;
            }
            realdata = s;
            dataGridView1.Rows.Clear();
            IEnumerable <IGrouping <float, BuyOrder> > collection = buylist.GroupBy(b => b.orderPrice).OrderBy(b => b.Key).Reverse();

            foreach (IGrouping <float, BuyOrder> orders in collection)
            {
                int vol = 0;

                //go through each buyorder
                foreach (BuyOrder buyo in orders)
                {
                    vol += buyo.orderSize;
                    //pocket full of mumbles
                    dataGridView1.Rows.Add(orders.Count(), vol, orders.Key);    //orders.count() is how many times that order was made
                }
            }

            IEnumerable <IGrouping <float, BuyOrder> > collection2 = buylist.GroupBy(b => b.orderPrice).OrderBy(b => b.Key).Reverse();



            dataGridView2.Rows.Clear();
            foreach (IGrouping <float, BuyOrder> orders2 in collection2)
            {
                int vol = 0;

                //go through each buyorder
                foreach (BuyOrder buyo in orders2)
                {
                    vol += buyo.orderSize;
                    //pocket full of mumbles
                    dataGridView2.Rows.Add(orders2.Count(), vol, orders2.Key);   //orders.count() is how many times that order was made
                }
            }
        }