Analysis.KPCA.MainForm.MenuFileOpen_Click C# (CSharp) Method

MenuFileOpen_Click() private method

Launched when the user clicks the File -> Open menu item.
private MenuFileOpen_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void MenuFileOpen_Click(object sender, EventArgs e)
        {
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string filename = openFileDialog.FileName;
                string extension = Path.GetExtension(filename);
                if (extension == ".xls" || extension == ".xlsx")
                {
                    ExcelReader db = new ExcelReader(filename, true, false);
                    TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList());

                    if (t.ShowDialog(this) == DialogResult.OK)
                    {
                        DataTable tableSource = db.GetWorksheet(t.Selection);
                        this.dgvAnalysisSource.DataSource = tableSource;
                        this.dgvProjectionSource.DataSource = tableSource.Copy();

                        double[][] graph = tableSource.ToArray(out columnNames);
                        inputScatterplot.DataSource = graph;
                        CreateScatterplot(graphMapInput, graph);

                        lbStatus.Text = "Now, click 'Run analysis' to start processing the data!";
                    }
                }
            }
        }