private void orderListMenuItem_Click(object sender, EventArgs e) { StockPortofolio portofolio = this.StockPortofolioList.Get(sender.ToString()); if (orderListDlg == null) { orderListDlg = new OrderListDlg(StockDictionary, portofolio.OrderList); orderListDlg.SelectedStockChanged += new SelectedStockChangedEventHandler(OnSelectedStockChanged); orderListDlg.StockOrderDeleted += new StockOrderDeletedEventHandler(OnStockOrderDeleted); orderListDlg.FormClosing += new FormClosingEventHandler(orderListDlg_FormClosing); orderListDlg.Show(); } else { orderListDlg.Activate(); } }
private void orderGenerationDlg_SimulationCompleted() { // Refresh portofolio generated stock StockPortofolio portofolio = this.orderGenerationDlg.SelectedPortofolio; portofolio.Initialize(StockDictionary); StockDictionary.CreatePortofolioSerie(portofolio); // Refresh the screen OnNeedReinitialise(true); //Display portofolio window if (orderListDlg == null) { orderListDlg = new OrderListDlg(StockDictionary, portofolio.OrderList); orderListDlg.SelectedStockChanged += new SelectedStockChangedEventHandler(OnSelectedStockChanged); orderListDlg.FormClosing += new FormClosingEventHandler(orderListDlg_FormClosing); orderListDlg.StockOrderDeleted += new StockOrderDeletedEventHandler(OnStockOrderDeleted); orderListDlg.Show(); } else { orderListDlg.SetOrderList(portofolio.OrderList); orderListDlg.Activate(); } RefreshPortofolioMenu(); }