private void chkLoadStudioTMs_CheckedChanged(object sender, EventArgs e) { if (chkLoadStudioTMs.Checked) { var tms = _tmHelper.LoadLocalUserTms(); foreach (var tm in tms) { lstTms.Items.Add(tm); } if (lstTms.Items.Count > 0) { btnReindex.Enabled = true; } else { rtbStatus.AppendText(Constants.NoLocalTmMsg); } } else { var toRemoveItems = (from object item in lstTms.Items let tmInfo = item as TranslationMemoryInfo where tmInfo.IsStudioTm select item).ToList(); foreach (var item in toRemoveItems) { lstTms.Items.Remove(item); } } }
private void chkLoadStudioTMs_CheckedChanged(object sender, EventArgs e) { if (chkLoadStudioTMs.Checked) { var tms = _tmHelper.LoadLocalUserTms(); foreach (var tm in tms) { lstTms.Items.Add(tm); } } else { var toRemoveItems = (from object item in lstTms.Items let tmInfo = item as TranslationMemoryInfo where tmInfo.IsStudioTm select item).ToList(); foreach (var item in toRemoveItems) { lstTms.Items.Remove(item); } } }