Esempio n. 1
0
 private void ListView_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right && e.Clicks == 1)
     {
         var item = this.listView.FocusedItem;
         if (item.Bounds.Contains(e.Location))
         {
             var searchResults = this.listView.SelectedResults;
             this.favoriteContextMenuItem.CheckState = searchResults.All(r => r.Tags.Contains("favorite")) ? CheckState.Checked : CheckState.Unchecked;
             this.favoriteContextMenuItem.Tag        = searchResults;
             this.editTagsContextMenuItem.Tag        = searchResults;
             this.addPeopleContextMenuItem.Tag       = searchResults;
             this.findSimilarMenuItem.Enabled        = searchResults.All(r => FileTypeHelper.IsImage(r.FileType));
             this.itemContextMenu.Show(Cursor.Position);
         }
     }
 }