Posted By: Bas | Jul 4th @ 6:15 AM
page 1 of 1
Comments: 6 | Views: 605
Bas
Bas
It finds lightbulbs.

I have an enum that FxCop happens to be bugging me about (it's an IdentifiersShouldBeSpelledCorrectly warning), and I actually have good reason to name them as such, so I figured I'd suppress those warnings explicitly in code. However, the only way to do so as far as I can find is to add a SuppressMessage attribute to each member in the enum, which makes the whole thing practically unreadable. Is there any way to tell FxCop to just ignore the IdentifiersShouldBeSpelledCorrectly warning for every member in a certain enumeration?

Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

How about adding the names of the identifiers to the custom dictionary for the project?

W3bbo
W3bbo
The Master of Baiters

Or mark the Fxcop messages as Excluded?

I'm not a fan of using attributes like this since, as you say, it makes the code messy.

W3bbo
W3bbo
The Master of Baiters

That's what comments are for Smiley

Whilst we're on the subject, I hate having to put Enum member info on their own line in <summary> blocks. I'd prefer it if the C# documentation generator did a similar thing to the C++ doc generator and include // comments made on the same line as the member.

So rather than:

public enum Foo {
    /// <summary>Some member (0xFF)</summary>
    Bar = 0xFF,
    Baz,
}

You can do this:

public enum Foo {
    Bar = 0xFF, // Some member
    Baz,
}

I'd also like it if intellisense showed you the numeric value of an enum member rather than having to put a copy in the <summary> comment.

page 1 of 1
Comments: 6 | Views: 605
Microsoft Communities