I have a c# .net 2.0CF application where I would like to get not only the type and value of a parameter passed to the function, but also the variable name.
For example:
void Show<PARAM>(PARAM p)
{
Debug.WriteLine(string.Format("{0} {1} = {2}", typeof(PARAM).ToString, ???, p.ToString() );
}
bool foo = true;
Show(foo);
would output "bool foo = true";
In C++, I can do this with the ##
pre-processor macro.
If this can't be done in 2.0, can it be done in 3.5 or 4.0?
Thanks, PaulH