Add rule to check all the fields are not prefixed with there DataType

Jul 23, 2012 at 6:18 AM

I would like to add a rule to style cop which validates that all the fields having any type of access modifier should not be fixed with there type.

For Example : int intData= 0; //here the varilable is prefixed with int which is its datatype. which is wrong according to our organization coding standards.

int dataCount =0  // is the correct way od declaring variables

sting dataInfo = String.Empty; // is correct

string strDataInfo = string.empty //is wrong


Can anyoneplease suugest me how to write the custom rule for such validation for checking for all the varialbles declared globally or locally in the entire code file.

Jul 23, 2012 at 4:36 PM

Is existing rule SA1305 (FieldNamesMustNotUseHungarianNotation) not catching these problems?