private void mnuRemove_Click(object sender, EventArgs e) { if (SelectedIndexs.Count > 0) { var parts = SelectedIndexs .Select(i => Folder.PartIndexs[i]) .ToList(); string text; if (parts.Count == 1) { text = string.Format("确定把\"{0}\"删除", Database.ImagePartTable[parts[0]].Name); } else { text = string.Format("确定把{0}项删除", parts.Count); } var res = MessageBox.Show( text, "确定删除", MessageBoxButtons.OKCancel); if (res == DialogResult.OK) { SelectedIndexs.Clear(); SelectedItemsChanged(this, null); foreach (var part in parts) { Remove(part); } UpdateSize(false); } } }
public IEnumerable <ImagePart> GetSelectedItems() { return(SelectedIndexs.Select(i => Database.ImagePartTable[Folder.PartIndexs[i]])); }