public void Save() { _file.Clear(); foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value is string key) { _file[key] = row.Cells[1].Value as ILocalizeContent <object>; } } }