private void btnGenerateDefaults_Click(object sender, EventArgs e) { using (new AutoCursor(this)) { var tablesToRecreate = new List <string>(); foreach (ListViewItem lvi in lvMissingTableMappings.CheckedItems) { tablesToRecreate.Add(lvi.Tag as string); } AdminProxy.RecreateTableMappings(tablesToRecreate); DialogResult = DialogResult.OK; this.Close(); AdminProxy.ClearCache(null); MainFormRefreshData(); if (tablesToRecreate.Count == 1) { MainFormUpdateStatus(getDisplayMember("rebuilt{one}", "Rebuilt mappings for {0}", tablesToRecreate[0]), true); } else { MainFormUpdateStatus(getDisplayMember("rebuilt{many}", "Rebuilt mappings for {0} tables", tablesToRecreate.Count.ToString("###,##0")), true); } } }