Possible? Converting local variables into global's?
Hi,
I just installed ReSharper (C#, VS 2010) and I'm blown away by its features - and I'm a little bit lost. For a mobile application I need to change all local variables, declared inside methods, into globals variables - declared in the class itself. This is for avoiding memory leaks as I'm fighting for every free kb. I have not found a way to achieve this task with ReSharper. Is it possible at all or do I need to convert the variables manually? Thanks for you advice in advance!
Thor
Please sign in to leave a comment.
Hi.
Have you tried 'introduce variable' refactoring? It was not designed for
your particular case but anyway it can be helpful. It creates field from
the local variable, replaces occurrences and removes variable declaration.
Unfortunately you have to run this refactoring on each variable.
Thanks! That is exactly what I was looking for.