private void Open_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { try { LinesFile file = new LinesFile(openFileDialog.FileName); List <Line> lines = file.ReadLines(); Input.SetMatrix(LineConvert.LineListToMatrix(lines)); } catch (Exception ex) { MessageBox.Show(ex.Message, "ошибка"); } } }
static List <Line> FileInput(string Path) { LinesFile file = new LinesFile(Path); return(file.ReadLines()); }