Пример #1
0
        public BigTradeUI(BigTrades engine)
        {
            // save our response engine
            _engine = engine;
            // setup grid
            InitializeComponent();
            // here our the columns we'll save for 10ten trades
            _dt.Columns.Add("Time", typeof(int));
            _dt.Columns.Add("Sym");
            _dt.Columns.Add("Price", typeof(decimal));
            _dt.Columns.Add("TradeSize", typeof(int));
            _dt.Columns.Add("Exch");
            _dg.MultiSelect = false;
            // we'll bid the above columns to our grid
            _bs.DataSource = _dt;
            _dg.DataSource = _bs;
            // setup right click
            ContextMenu = new ContextMenu();
            ContextMenu.MenuItems.Add("Buy 100 Market", new EventHandler(butbuy_Click));
            ContextMenu.MenuItems.Add("Sell 100 Market", new EventHandler(butsell_Click));

            // then the grid to the user
            Show();
            // make sure to invalidate and unsubscribe on form closing
            // otherwise, it will continue to process in background
            FormClosing += new FormClosingEventHandler(BigTradeUI_FormClosing);
        }
Пример #2
0
        public BigTradeUI(BigTrades engine)
        {
            // save our response engine
            _engine = engine;
            // setup grid
            InitializeComponent();
            // here our the columns we'll save for 10ten trades
            _dt.Columns.Add("Time", typeof(int));
            _dt.Columns.Add("Sym");
            _dt.Columns.Add("Price", typeof(decimal));
            _dt.Columns.Add("TradeSize", typeof(int));
            _dt.Columns.Add("Exch");
            _dg.MultiSelect = false;
            // we'll bid the above columns to our grid
            _bs.DataSource = _dt;
            _dg.DataSource = _bs;
            // setup right click
            ContextMenu = new ContextMenu();
            ContextMenu.MenuItems.Add("Buy 100 Market", new EventHandler(butbuy_Click));
            ContextMenu.MenuItems.Add("Sell 100 Market", new EventHandler(butsell_Click));

            // then the grid to the user
            Show();
            // make sure to invalidate and unsubscribe on form closing
            // otherwise, it will continue to process in background
            FormClosing += new FormClosingEventHandler(BigTradeUI_FormClosing);
        }