Regular Expressions for Visual Studio Code Analysis

By Michael Flanakin @ 1:30 PM :: 1158 Views :: 1 Comments :: .NET 2.0 :: Digg it!

CA1802 - Use Literals Where Appropriate

This one is so simple, it's pointless to even mention. All it means is that static readonly fields should be const. Heck, there's not even a need for regex; but, since I'm so cool, I'm going to add a little regex to it. Actually, the regex is kind of necessary to ensure all cases are covered correctly, seeing as tho spacing can be accomplished however the developer sees fit.

Find: <static>:Wh+<readonly>
Replace: const

 

Ratings

Comments

By Joben.Rara.blogs(".NET") @ Monday, June 25, 2007 11:22 AM

Click here to post a comment



Categories Categories