private void ButOpen_Click(object sender, EventArgs e) { if (FileOpenClick != null) { FileOpenClick(this, EventArgs.Empty); } var wtf = new OpenFileDialog() { Filter = "Файлы заказа|*.txt" }; var result = wtf.ShowDialog(this); if (result == DialogResult.OK) { var mem = Kekus.LoadFromFile(wtf.FileName); SetModelToUI(mem); Setter(mem); } }
private void ButSave_Click(object sender, EventArgs e) { if (FileSaveClick != null) { FileSaveClick(this, EventArgs.Empty); } var wtf = new SaveFileDialog() { Filter = "Файлы заказов|*.txt" }; var result = wtf.ShowDialog(this); if (result == DialogResult.OK) { var mem = GetModelFromUI(); Saver(mem); Kekus.WriteToFile(wtf.FileName, mem); } }