Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
QuestionGetting the Namespace/Name of the calling method Pin
MrEyes21-Dec-05 0:57
MrEyes21-Dec-05 0:57 
AnswerRe: Getting the Namespace/Name of the calling method Pin
Guffa21-Dec-05 1:08
Guffa21-Dec-05 1:08 
GeneralRe: Getting the Namespace/Name of the calling method Pin
MrEyes21-Dec-05 1:12
MrEyes21-Dec-05 1:12 
GeneralRe: Getting the Namespace/Name of the calling method Pin
Vikram A Punathambekar21-Dec-05 1:17
Vikram A Punathambekar21-Dec-05 1:17 
GeneralRe: Getting the Namespace/Name of the calling method Pin
MrEyes21-Dec-05 1:21
MrEyes21-Dec-05 1:21 
GeneralRe: Getting the Namespace/Name of the calling method Pin
leppie21-Dec-05 4:10
leppie21-Dec-05 4:10 
GeneralRe: Getting the Namespace/Name of the calling method Pin
MrEyes21-Dec-05 4:15
MrEyes21-Dec-05 4:15 
GeneralRe: Getting the Namespace/Name of the calling method Pin
leppie21-Dec-05 4:28
leppie21-Dec-05 4:28 
This is what I got Smile | :)
[Conditional(<FONT color=maroon>"TRACE"</FONT>)]
<FONT color=blue>public static void</FONT> WriteLine(<FONT color=blue>string</FONT> category, <FONT color=blue>string</FONT> format, <FONT color=blue>params object</FONT><FONT color=darkblue>[]</FONT> args)
{
  <FONT color=blue>if</FONT> (debugmode)
  {
    <FONT color=darkgreen>// get the caller</FONT>
    StackTrace st = <FONT color=blue>new</FONT> StackTrace(<FONT color=blue>false</FONT>);
    StackFrame sf = st.GetFrame(<FONT color=red>2</FONT>);
    <FONT color=blue>string</FONT> msg = <FONT color=blue>string</FONT>.Format(<FONT color=maroon>"{0,-15}:{1,-60}:{2}"</FONT>, category,
      sf.GetMethod(), <FONT color=blue>string</FONT>.Format(format, args).Replace(<FONT color=maroon>"\n"</FONT>, <FONT color=maroon>"\\n"</FONT>).Replace(<FONT color=maroon>"\t"</FONT>,<FONT color=maroon>"\\t"</FONT>));
    System.Diagnostics.Trace.WriteLine(msg);
  }
  <FONT color=blue>else</FONT>
  {
    <FONT color=blue>string</FONT> msg = category + <FONT color=maroon>" : "</FONT> + <FONT color=blue>string</FONT>.Format(format, args);
    System.Diagnostics.Trace.WriteLine(msg);
  }
}


xacc.ide-0.1.1 released! :) Download and screenshots
QuestionExecutable Pin
charbelasmar21-Dec-05 0:33
charbelasmar21-Dec-05 0:33 
AnswerRe: Executable Pin
Vikram A Punathambekar21-Dec-05 1:19
Vikram A Punathambekar21-Dec-05 1:19 
AnswerRe: Executable Pin
Vikram A Punathambekar21-Dec-05 1:19
Vikram A Punathambekar21-Dec-05 1:19 
GeneralRe: Executable Pin
J4amieC21-Dec-05 3:23
J4amieC21-Dec-05 3:23 
GeneralRe: Executable Pin
Vikram A Punathambekar21-Dec-05 16:17
Vikram A Punathambekar21-Dec-05 16:17 
QuestionUser Controls access Page variable Pin
vinyladdict21-Dec-05 0:00
vinyladdict21-Dec-05 0:00 
QuestionGUI Question Pin
HolyGrandFather20-Dec-05 23:04
HolyGrandFather20-Dec-05 23:04 
AnswerRe: GUI Question Pin
WetRivrRat21-Dec-05 6:32
WetRivrRat21-Dec-05 6:32 
QuestionReverse Engineering Added Numbers Pin
redfish3420-Dec-05 22:41
redfish3420-Dec-05 22:41 
AnswerRe: Reverse Engineering Added Numbers Pin
Colin Angus Mackay20-Dec-05 22:49
Colin Angus Mackay20-Dec-05 22:49 
GeneralRe: Reverse Engineering Added Numbers Pin
J4amieC20-Dec-05 22:59
J4amieC20-Dec-05 22:59 
GeneralRe: Reverse Engineering Added Numbers Pin
Colin Angus Mackay20-Dec-05 23:04
Colin Angus Mackay20-Dec-05 23:04 
GeneralThanks Pin
redfish3423-Dec-05 1:22
redfish3423-Dec-05 1:22 
QuestionStruct of array Pin
peppepinna20-Dec-05 22:32
peppepinna20-Dec-05 22:32 
AnswerRe: Struct of array Pin
Colin Angus Mackay20-Dec-05 22:41
Colin Angus Mackay20-Dec-05 22:41 
GeneralRe: Struct of array Pin
peppepinna20-Dec-05 22:56
peppepinna20-Dec-05 22:56 
GeneralRe: Struct of array Pin
peppepinna20-Dec-05 23:08
peppepinna20-Dec-05 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.