tags:

views:

66

answers:

2

How do I widen the cope of a variable using ReSharper?

from:

public class MyClass
{
   public void DoSomething() 
   { 
      string widenMe = null; // i want to widen this 
   } 
 }

to:

public class MyClass 
{
   string widenMe = null; 

   public void DoSomething() 
   {  
   } 
}

Cheers,

S

+2  A: 

Hi,

Click on your variable name (widenMe) and Ctrl+R, Ctrl+F to make it a field.

tomzx
Just to note, this is based on the VS Keyboard map.
Zhaph - Ben Duguid
+2  A: 

Introduce Field (ctrl + alt + D)

Jim Arnold
+1, but that only works if you're using the 2.x/IDEA keyboard scheme ;)
Zhaph - Ben Duguid