How do I add/create a short-cut for a specific quick-fix action in R#9

One of my actions:

[ContextAction(Name = "Quick fix action", Description = "Quick fix action", Group = "C#")] 

public class ExtractActionAction : ContextActionBase
{
   ....
}

1 comment

You can't - they're different things. A context action is an action that's available, via alt+enter, at a particular location in the code. However, you can add an Action that is implemented based on the context action. This would be a normal action that derives from ContextActionAsActionHandler<T> where T is the type of the context action. This base class will try to instantiate the context action, check if it's available (which will grey out the action if not) and execute it if invoked. This action can then have shortcuts applied, via the ActionAttribute.

0

Please sign in to leave a comment.