7 comments
Comment actions Permalink

http://testcop.codeplex.com/SourceControl/latest#Project/Src/TestCop.Plugin/QuickFixActions/DeleteFileBulbItem.cs


public IEnumerable<IntentionAction> CreateBulbItems()
        {            
            var list = new List<IntentionAction>();                                  

            var anchor=  _highlight.FileOnDisk.Count==1 ? new InvisibleAnchor(IntentionsAnchors.ContextActionsAnchorPosition, IntentionsAnchors.ContextActionsAnchor, false)
            : (IAnchor) new ExecutableGroupAnchor(IntentionsAnchors.ContextActionsAnchor, null, false);


            if (_highlight.FileOnDisk.Count > 1)
            {
                list.AddRange(BulbActionExtensions.ToQuickFixAction(new RemoveFileBulb(_highlight.CurrentProject, _highlight.FileOnDisk.ToArray()), anchor, UnnamedThemedIcons.Agent16x16.Id));
            }

            _highlight.FileOnDisk.ForEach(f=>
                list.AddRange(BulbActionExtensions.ToQuickFixAction(new RemoveFileBulb(_highlight.CurrentProject, new[] { f }), anchor, UnnamedThemedIcons.Agent16x16.Id))
            );
       
            return list;    
        }

0
Comment actions Permalink

Sorry, it is not clear for me how this related to bulk actions.
I would like applying my fixes in file|project|solution scope like this
https://www.jetbrains.com/img/webhelp/fix_in_scope.png

0
Comment actions Permalink

Bulk actions aren't documented at the moment. This Google Groups post gives a brief intro of how to work with bulk actions. Essentially, your context action/quick fix need to implement one of the interfaces that derives from IBulkAction. ReSharper recognises the derived interface and handles everything for you.

0
Comment actions Permalink

Apologies. My instant thought was bulk action within a single file

0
Comment actions Permalink

Check out the google groups post I linked to in the other reply - you don't need to add the scope items yourself as long as you implement one of the interfaces that derive from IBulkAction. ReSharper will add the menu items for you. The derived bulk action interfaces provide methods for fixing a bunch of highlights, a set of files, and so on.

0
Comment actions Permalink

No need to apologise :) But I'm not sure what you mean about bulk actions in a single file?

0
Comment actions Permalink

Thanks a lot. I used IHighlightingsSetAction and it works perfect

0

Please sign in to leave a comment.