Create backing variable - two questions
Firstly, very impressed by the new v3.0. I had given up on R# in v2.0 because of constant crashes, and I've been tempted back!
I've been using R# to try and improve my use of TDD, and have hit two small issues with property generation that I can't find solutions for:
1. When generating a property (Alt-Enter for property, then Alt-Enter for backing variable), the property picks up my naming style of prefixing an underscore, but I can't work out how to use lower case (e.g. Name -> _name). Currently I get _Name.
2. When the backing variable is created it moves it to the top of the class. Is there any way of forcing backing variables to stay with their property declaration?
Thanks for any help....
Please sign in to leave a comment.
Hello gjstockham,
1. Tell ReSharper about your naming preferences, Options / Languages / Common
/ Naming Style. Just add "_" as a prefix to fields.
2. Currently it is not configurable.
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
g> Firstly, very impressed by the new v3.0. I had given up on R# in
g> v2.0 because of constant crashes, and I've been tempted back!
g>
g> I've been using R# to try and improve my use of TDD, and have hit two
g> small issues with property generation that I can't find solutions
g> for:
g>
g> 1. When generating a property (Alt-Enter for property, then Alt-Enter
g> for backing variable), the property picks up my naming style of
g> prefixing an underscore, but I can't work out how to use lower case
g> (e.g. Name -> _name). Currently I get _Name.
g>
g> 2. When the backing variable is created it moves it to the top of the
g> class. Is there any way of forcing backing variables to stay with
g> their property declaration?
g>
g> Thanks for any help....
g>
Same problem for the 1).
I added the "_" prefix and it works fine. But the casing is not correct: for
the property Name R# generate the field _Name and not _name .
Thanks
emanuele
Yes, I'm still having the same problem as Emanuele with Name being generated as _Name instead of _name