I have been trying for some days to implement the Resource file "rename resource" refactor, which is explained here: http://www.jetbrains.com/resharper/features/internationalization.html
This changes a resource file resource string name by another valid string value and replaces all occurrences it finds.
First I get the ISolution and navigate through all its projects through GetAllProjects() method, getting all its subItems through GetSubItems() and recursively on the folders, getting all resource files.
On the resource files, I navigate the Data Tags (resource file entries) through GetDataTags() method so I have all the resource files and its resource strings.
Let's say that I want to replace the resource string names by GUID's so they are unique...
The benefits of this are automating the resource string rename of the full solution's resource string names so saving a lot of hours of refactoring of the XAML views and source code files.. And also to save the time in doing that manually as well.
I have gotten a bit of support from ReSharper experts and the latest approach is the following piece of code (that is not working):
private void ChangeResourceStringNameRefactor(IResxDataTagDeclaration resxDataTagDeclaration, IDataContext context)
var guidstring = Guid.NewGuid().ToString();
var guidstringWithoutarrows = guidstring.Replace("-", "");
Lifetimes.Using(lifetime => this.ExecuteResourceRename(context, guidstringWithoutarrows));
public void ExecuteResourceRename(IDataContext context, string name)
var provider = RefactoringsManager.Instance.GetWorkflowProviders<RenameResourceWorkflowProvider>().FirstOrDefault();
if (provider != null)
var workflow = provider.CreateWorkflow(context).OfType<RenameResourceDrivenWorkflow>().FirstOrDefault();
if (workflow != null && workflow.IsAvailable(context))
workflow.Args.ResourceElementNewName = name;
The problem is that workflow.IsAvailable(context) always returns null so it cannot be executed.
Any guidance, help or link on this matter would be great.
Thanks in advance,