Where do you edit the constructor template on resararper 4.1?

When I create a constructor with parameters using Resharper's 'Generate code' function, I get something like this:

public class Example{
     private int _x;
     private int _y;

     public Example(int _x, int _y){
         this._x = _x;
         this._y = _y;
     }
}

      

I would like to use this naming convention:

public class Example{
     private int _x;
     private int _y;

     public Example(int x, int y){
         _x = x;
         _y = y;
     }
}

      

but I don't know if this constructor pattern can be changed and where.

0


source to share


3 answers


Options / Languages ​​/ General / Naming Style You must prefix the underline field.



+4


source


Go to Resharper -> Live Templates -> C # -> find the ctor class and templates and right click them to make the settings you want ...



This will also help you Live Templates Help

+1


source


This is the sample I just created:

inner class MyClass {private string myField;

    public MyClass(string myField)
    {
        this.myField = myField;
    }
}

      

0


source







All Articles