private void open_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { try { FileTls fileTls = new FileTls(openFileDialog.FileName); bool[,] Matrix = fileTls.ReadBoolMatrix(); DataGridViewUtils.Array2ToGrid(Grid, Matrix); } catch (Exception eror) { MessageBox.Show(eror.Message, "ошибка"); } } }
private static bool[,] BoolMatrixFile() { while (true) { try { Console.Write("введите имя файла: "); FileTls fileTls = new FileTls(Console.ReadLine()); bool[,] Matrix = fileTls.ReadBoolMatrix(); return(Matrix); } catch (Exception eror) { Console.WriteLine(eror.Message); } } }