I am running .NET CF 2.0 Service Pack 1.
Thanks,
However, the class name can be retrieved by doing something like this....
this.GetType().ToString();
If the info is only needed during debug sessions, then use a conditional
break point and log to the Output window as follows...
Set a break point where you want a log message to be created.
Right click on the break point.
Chose "When hit..." form the popup menu.
Check "Print a message"
The default message format includes the method name, thread ID, and thread
name. I've found the $CALLSTACK variable to be very handy at times.
-Drew
"stealthrabbi" <mark.f...@gmail.com> wrote in message
news:a7c004b7-13d9-443c...@s50g2000hsb.googlegroups.com...
Hi,
Looking at the type at run time is not good thing for compact
framework.
The call to GetType is not probably worth for this kind of things.
You might want to consider keeping the name of class in with some
string variables.
Create a generic logger just to write in your log file or use can use
Log4Net.
Class A
{
static string className = "A";
public int Add(int a, int b)
{
if(EnabledTrace)
{
loggger.log("Entering Class : A, method:Add");
}
}
}
This might be better way.
Let me know if this works out.
Thanks,
Jayesh Modha
This works, but this doesn't solve my problem of not knowing the class/
function name at run time. i'd have to copy/paste that wherever i want
to log and change the literal strings.