private void pullSaves() { try { string lastPath = MainFile.pullSavesLine(); mainFile = new MainFile(lastPath); } catch { mainFile = new MainFile(String.Empty); BTN_Prev.Enabled = false; BTN_Next.Enabled = false; BTN_SaveAll.Enabled = false; } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; if (ofd.ShowDialog() == DialogResult.OK) { string path = ofd.FileName; try { mainFile = new MainFile(path); init(); } catch { MessageBox.Show("Невозможно открыть выбранный файл", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }