IEnumerable <ICSharpCode.NRefactory.CSharp.Refactoring.CodeAction> GetActions(ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue issue, MDRefactoringContext context)
 {
     foreach (var action in issue.Actions)
     {
         yield return(action);
     }
     if (boundActionProvider != null)
     {
         // We need to se the correct location here. Seems very fragile to do so...
         context.SetLocation(issue.Start);
         foreach (var action in boundActionProvider.GetActions(context))
         {
             yield return(action);
         }
     }
 }
Example #2
0
        IEnumerable <NRefactoryCodeAction> GetActions(ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue issue, MDRefactoringContext context)
        {
            foreach (var action in issue.Actions)
            {
                yield return(new NRefactoryCodeAction(IdString, action.Description, action, action.SiblingKey));
            }

            if (issue.ActionProvider != null)
            {
                foreach (var provider in issue.ActionProvider)
                {
                    var boundActionProvider = (ICSharpCode.NRefactory.CSharp.Refactoring.CodeActionProvider)Activator.CreateInstance(provider);
                    context.SetLocation(issue.Start);
                    foreach (var action in boundActionProvider.GetActions(context))
                    {
                        yield return(new NRefactoryCodeAction(provider.FullName, action.Description, action, action.SiblingKey));
                    }
                }
            }
        }