private void palmaresMenuItem_Click(object sender, EventArgs e) { if (palmaresDlg == null) { palmaresDlg = new PalmaresDlg(StockDictionary, this.WatchLists, this.selectedGroup, this.progressBar); palmaresDlg.SelectedStockChanged += new SelectedStockChangedEventHandler(OnSelectedStockChanged); palmaresDlg.SelectedPortofolioChanged += new SelectedPortofolioNameChangedEventHandler(OnCurrentPortofolioNameChanged); palmaresDlg.SelectStockGroupChanged += new SelectedStockGroupChangedEventHandler(this.OnSelectedStockGroupChanged); palmaresDlg.FormClosing += new FormClosingEventHandler(palmaresDlg_FormClosing); palmaresDlg.StockWatchListsChanged += new StockWatchListsChangedEventHandler(OnWatchListsChanged); if (sender is SimulationParameterControl) { SimulationParameterControl simulationParameterControl = (SimulationParameterControl)sender; this.palmaresDlg.StartDate = simulationParameterControl.StartDate; this.palmaresDlg.EndDate = simulationParameterControl.EndDate; this.palmaresDlg.DisplayPortofolio = true; this.palmaresDlg.InitializeListView(); } palmaresDlg.Show(); } else { if (sender is SimulationParameterControl) { SimulationParameterControl simulationParameterControl = (SimulationParameterControl)sender; this.palmaresDlg.StartDate = simulationParameterControl.StartDate; this.palmaresDlg.EndDate = simulationParameterControl.EndDate; this.palmaresDlg.DisplayPortofolio = true; } this.palmaresDlg.InitializeListView(); palmaresDlg.Activate(); } }
private void palmaresDlg_FormClosing(object sender, FormClosingEventArgs e) { palmaresDlg = null; }