private void Form2_Load(object sender, EventArgs e) { DataGridViewUtils.InitGridForArr(InDGV, 30, false, true, true, true, true); DataGridViewUtils.InitGridForArr(OutDGV, 30, true, true, true, true, true); inputOpenFileDialog.InitialDirectory = Task2_BL.IOUtils.ExeDir; inputSaveFileDialog.InitialDirectory = Task2_BL.IOUtils.ExeDir; outputSaveFileDialog.InitialDirectory = Task2_BL.IOUtils.ExeDir; }
private void ReadButton_Click(object sender, EventArgs e) { if (inputOpenFileDialog.ShowDialog() == DialogResult.OK) { try { io.Text = io.ReadFromFile(inputOpenFileDialog.FileName); DataGridViewUtils.ArrayToGrid(InDGV, io.Text); } catch (Exception except) { FormsUtils.ErrorMessageBox(except); } } }
private void SortButton_Click(object sender, EventArgs e) { int[] arr = DataGridViewUtils.GridToArray <int>(InDGV); int[] sorted = io.CompressSort(arr); DataGridViewUtils.ArrayToGrid(OutDGV, sorted); }