private void SaveList() { IToyListService saveList = ServiceFactory.getService(currentFile.Extension); saveList.Save(toys, currentFile.FullName); ListIsChanged = false; }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.Cancel) { return; } if (ListIsExist && !TryDeleteList()) { return; } InitWorkWithList(openFileDialog.FileName); IToyListService loadList = ServiceFactory.getService(currentFile.Extension); toys = loadList.Load(currentFile.FullName); RefreshGrid(); }