Skip to content

Gendarme.Rules.Naming.UseCorrectPrefixRule(git)

Sebastien Pouliot edited this page Mar 2, 2011 · 1 revision

UseCorrectPrefixRule

Assembly: Gendarme.Rules.Naming
Version: git

Description

This rule ensures that types are prefixed correctly. Interfaces should always be prefixed with a I, types should never be prefixed with a C (reminder for MFC folks) and generic parameters should be a single, uppercased letter or be prefixed with T.

Examples

Bad examples:

public interface Phone {
    // ...
}
public class CPhone : Phone {
    // ...
}
public class Call<Mechanism> {
    // ...
}

Good examples:

public interface IPhone {
    // ...
}
public class Phone : IPhone {
    // ...
}
public class Call<TMechanism> {
    // ...
}

Source code

You can browse the latest source code of this rule on github.com

Clone this wiki locally