private void Used_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (LBUsed.SelectedItem != null) { foreach (var ext in UsedExtensions) { if (ext.ToString().Equals(LBUsed.SelectedItem.ToString())) { AvaliableExtensions.Add(ext); UsedExtensions.Remove(ext); break; } } } }
private void LBUsed_KeyDown(object sender, KeyEventArgs e) { if (Key.Delete == e.Key) { List <FileExtensionClass> toDelete = new List <FileExtensionClass>(); foreach (FileExtensionClass listViewItem in ((ListView)sender).SelectedItems) { toDelete.Add(listViewItem); } foreach (var item in toDelete) { UsedExtensions.Remove(item); } } }