1
Answer

Variable name

Mohamed Ihjas

Mohamed Ihjas

16y
2.7k
1
I was creating a rule in fxcop to check the naming convention , but I cannot access the local variable name. the field name access only instatc variable.
my code like this.. pls help me how to access local variable name also.

public override ProblemCollection Check(Member member)
           {
            //if (member == null)
            //{
            //    return base.Problems;
            //}
               //get field name


             Field field = member as Field;

               if (field == null)
            {
                return base.Problems;
            }

            string name = field.Name.Name;
            if (name == null)
            {
                return base.Problems;
            }
}
Answers (1)