private void lOADToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "MyGraphic files (*.mgr)|*.mgr"; if (ofd.ShowDialog() == DialogResult.OK) { try { BinSerializer.Deserialize(ofd.FileName, ref lines, ref ListOfGroups); MessageBox.Show("Файл успешно загружен!"); DrawAllLines(); } catch { } } }
private void sAVEASToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "MyGraphic files (*.mgr)|*.mgr"; if (sfd.ShowDialog() == DialogResult.OK) { try { BinSerializer.Serialize(sfd.FileName, lines, ListOfGroups); MessageBox.Show("Успешно сохранено!"); } catch { } } }