private void btnApply_Click(object sender, EventArgs e) { // Copy LIMSList to LIMSBaseList and write to <dbname>_LIMS.fasta. //LIMSBaseList = LIMSList.ToDictionary(entry => entry.Key, entry => entry.Value); LIMSBaseList = new Dictionary <string, string>(); foreach (string key in LIMSList.Keys) { LIMSBaseList.Add(LIMSList[key], key); } ServiceCallHelper.WriteLIMSData(AppConfigHelper.LoggedOnUser, AppConfigHelper.JsonConfig(), LIMSBaseList); btnApply.Enabled = btnOK.Enabled = AnyChanges(); // There should not be any. lstSampleIDs.ItemCheck -= lstSampleIDs_ItemCheck; lstSampleIDs.SetItemChecked(lstSampleIDs.SelectedIndex, true); lstSampleIDs.ItemCheck += lstSampleIDs_ItemCheck; }