예제 #1
0
 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;
             }
         }
     }
 }
예제 #2
0
 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);
         }
     }
 }