3
namespace ICSharpCode.NRefactory.CSharp.Refactoring
6
/// A specialized code action creates a code action assoziated with one special type of ast nodes.
8
public abstract class SpecializedCodeAction<T> : ICodeActionProvider where T : AstNode
11
/// Gets the action for the specified ast node.
14
/// The code action. May return <c>null</c>, if no action can be provided.
16
/// <param name='context'>
17
/// The refactoring conext.
19
/// <param name='node'>
20
/// The AstNode it's ensured that the node is always != null, if called.
22
protected abstract CodeAction GetAction(RefactoringContext context, T node);
24
#region ICodeActionProvider implementation
25
public System.Collections.Generic.IEnumerable<CodeAction> GetActions(RefactoringContext context)
27
var node = context.GetNode<T>();
30
var action = GetAction(context, node);