Encapsulate Field: "Encapsulate references" option disabled

Hi there

For a few builds now, the "Encapsulate references" option in the
"Encapsulate Field" refactoring is disabled, and set to "All".

I really don't like RS to rewrite all my references to my fields within
the declaring class. Is this a bug (what's the point in two options if I
can't select them) or do I have to tweak this elsewhere?

Thanks,
Philipp

1 comment
Comment actions Permalink

I do have the same question!

Having ReSharper change e.g.

int someField;
SomeMethod() { ...someField++... }

to

private int someField;
public int SomeField { get { return someField; }}

SomeMethod() { ...someField = SomeField + 1;... }

is a nuisance!

Regards
Harald

0

Please sign in to leave a comment.