Naming style for flags-style enum

I would like it if ReSharper allowed me to specify different naming styles for ordinary enums and enums decorated with the [Flags] attribute. So then I could specify that ordinary enums must be EUpperCamelCase and flags-style enums must be FUpperCamelCase, for example.

Failing that, I'd like if one could specify multiple naming styles for an entity, so I can specify both EUpperCamelCase and FUpperCamelCase for enums.

Any chance of this becoming available? Or suggested alternative ways of doing what I'm looking for?

Thanks.

4 comments

> Failing that, I'd like if one could specify multiple naming styles for an entity, so I can specify both EUpperCamelCase and FUpperCamelCase for enums.

Sorry, I just discovered that this is possible. Very good.

Still, I'd prefer if my primary request of being able to have different rules for the two kinds of enums was possible.

Thanks.

0

Hello Rennie,

You're welcome to put this as a feature request at http://youtrack.jetbrains.net/issues/RSRP.
Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

of



0

Slightly off-topic, but that's a really bad naming convention. It's a form of Hungarian notation, which is strongly deprecated in .NET code.

The recommended naming convention is that ordinary enums have singular names - for example, StringComparison - and Flags enums have plural names - for example, AttributeTargets.

Names of Enumerations
http://msdn.microsoft.com/en-us/library/ms229040.aspx#5f8b6e50-1fc6-45b8-9b8c-f2a3f0723c4a

0

Hi Richard,

Thanks for your reply.

> It's a form of Hungarian notation ...

Yes, it's "One-garian notation".

http://ltuasoo.wordpress.com/2010/05/09/one-garian-notation/

I'm actually rather proud of it.

But thanks again for trying to point out the error of my ways.  :-)

0

Please sign in to leave a comment.