SubMain - CodeIt.Right The First Time!

/Community

A Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials Downloads
Welcome to SubMain Community Sign in | Join | Help

Only Interface types should have "I" prefix

Last post 07-07-2009, 12:19 AM by Serge B.. 1 replies.
Sort Posts: Previous Next
  •  07-05-2009, 12:04 AM 825

    Only Interface types should have "I" prefix

    I have some classes that are extensions of the built-in class IPAddress and therefore start with the letter I.  Is there a way to easily turn off this rule for the "Interfaces start with I" portion without disabling all the other checks that this rule is simultaneously performing?  Yes, I can decorate all the classes with an attribute to bypass this check, but it seems like an odd restriction to not let any class names start with an I.

    Thanks!

  •  07-07-2009, 12:19 AM 832 in reply to 825

    Re: Only Interface types should have "I" prefix

    Hello,

    Yes, the rule is following MS guidelines and in some real life cases it may conflict with your naming preferences.

    There are a couple of ways to work around this:

    • you can just Exclude the Violation
    • in Profile Editor for the rule "Only Interface types should have "I" prefix" and add the list of names to the ExcludeList property

    Adding attribute to a code element will have side effects for this particular rule. The rule is an instance of the UseOrAvoidCertainPrefixes which in turn has 5 or more instances. Adding the attribute will potentially suppress all 5 instances of the rule.

    Please let me know if this helps.

    Thank you,
    Serge Baranovsky
    http://submain.com - .NET Developer Tools  |  Microsoft VB MVP  |  http://vbcity.com - VB Developer Community
    » » (Static Code Analysis + Automatic Refactoring) / Painless Coding Guidelines = CodeIt.Right - http://submain.com/codeit.right
    » » C#/VB .NET Coding Guidelines - FREE 100+ page ebook (PDF) http://submain.com/guidelines
View as RSS news feed in XML
 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |