Protected naming style

I have a problem with one of the naming styles in Reshaper. Reshaper has two naming styles for fields (private / non-private).
For private fields I keep a lowercase style (camelCase) of for public fields (not properties) UpperCamelCase (PascalCasing).

The problem I have is that Reshaper doesn't recognize a protected field as private. As a result resharper advises me to use a UpperCamelCase naming style for the field, but that would collide with the associated property. A solution to this would be using a underscore prefix, but that would violate the Microsoft Design Guidelines which discourages the use of underscores, hyphens and other non-alphanumeric characters.

In my book a protected field is still private as it is not accessible from outside a (derived) class.

So can I add protected fields to the 'Instance Fields (private)' naming style or do I have to create a issue for this?

0
2 comments

Hi.

User defined naming  rules would help you. Open 'Naming style' options page, add new 'user defined rule', configure your rule (check 'field', 'protected', 'instance members and locals' and specify desired naming style).

0

I still can't believe I missed that option..

0

Please sign in to leave a comment.