private void InitialWindow_FormClosing(object sender, FormClosingEventArgs e) { InitialWindow initialWindow = (InitialWindow)sender; if (initialWindow.SelectedAction == InitialWindow.Action.Open) { fOpenFileDialog.ShowDialog(); this.Show(); NewDataLoaded(); } else if (initialWindow.SelectedAction == InitialWindow.Action.Import) { CsvImport csvImport = new CsvImport(); csvImport.Finished += new FinishedEventHandler(this.CsvImport_Finished); csvImport.Import(); } else if (initialWindow.SelectedAction == InitialWindow.Action.OpenRecent) { this.Show(); if (!OpenFile(initialWindow.Data)) { MessageBox.Show(Language.GetString("error.openErrorMessage") + " " + initialWindow.Data, Language.GetString("error.openErrorTitle"), MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { this.Show(); } }
private void fTMImport_Click(object sender, EventArgs e) { if (SafeCloseFile() != 1) { return; } CsvImport csvImport = new CsvImport(); csvImport.Finished += new FinishedEventHandler(this.CsvImport_Finished); csvImport.Import(); }