Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
AnswerRe: Printing a bill format Pin
OriginalGriff3-Sep-13 23:30
mveOriginalGriff3-Sep-13 23:30 
QuestionDaft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 5:21
Septimus Hedgehog3-Sep-13 5:21 
GeneralRe: Daft question on indenting text. Pin
harold aptroot3-Sep-13 5:36
harold aptroot3-Sep-13 5:36 
AnswerRe: Daft question on indenting text. Pin
Dave Kreskowiak3-Sep-13 5:37
mveDave Kreskowiak3-Sep-13 5:37 
AnswerRe: Daft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 5:58
Septimus Hedgehog3-Sep-13 5:58 
AnswerRe: Daft question on indenting text. Pin
jschell3-Sep-13 12:40
jschell3-Sep-13 12:40 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 20:36
Septimus Hedgehog3-Sep-13 20:36 
AnswerRe: Daft question on indenting text. Pin
BillWoodruff3-Sep-13 17:24
professionalBillWoodruff3-Sep-13 17:24 
One aspect of your scenario, abstracted to a general level, is: how to prevent recursion when method #3 ... invoked by method #2 ... invoked by method #1 ... "may" call method #1 ? imho, while you state your scenario is not recursive, reading your list of possible calls suggests it might be potentially recursive, and that you are doing something to prevent recursion.

Another, more probable, interpretation is: that you do have a non-recursive scenario here: because the methods are invoked as a result of the user's asynchronous direct actions on interface elements at run-time, so a call to any method may be followed by a call to any other method. I believe that if you wish to represent that as a "tree:" in a "literal" way: there could only be one "root node" (the first method called). Of course nothing "stops" you from treating every call to any given method as a "root node:" it's your choice.

But, on the basis of the information you supply, I can only guess at what's going on in the code, and whether you do, or don't, have to deal with potential recursion.

In general, I would "react" to code that implements an elaborate mechanism to prevent recursion, because it has to, as poorly designed code, most likely in need of re-factoring.

Have you considered, as an alternative to using an integer "level count" variable (which I don't see as "that big a deal"), using something like a .NET Stack data-structure when tracing is activated, and then pushing something onto the stack when any method is called; and, then, parsing that stack when you wish to create your text log-file ?

In WinForms writing tab characters into a text-file is simple "\t\tTwo tabs," and these could be shown at run-time in a WinForms TextBox if its 'AllowTabs property is set to 'true. Or, a WinForms RichTextBox can give you much finer-grained control over tabs, by setting them in code.

good luck, Bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview

GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 20:45
Septimus Hedgehog3-Sep-13 20:45 
GeneralRe: Daft question on indenting text. Pin
BillWoodruff3-Sep-13 23:29
professionalBillWoodruff3-Sep-13 23:29 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 0:35
Septimus Hedgehog4-Sep-13 0:35 
GeneralRe: Daft question on indenting text. Pin
BillWoodruff4-Sep-13 3:52
professionalBillWoodruff4-Sep-13 3:52 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 6:00
Septimus Hedgehog4-Sep-13 6:00 
AnswerRe: Daft question on indenting text. Pin
Bernhard Hiller3-Sep-13 22:40
Bernhard Hiller3-Sep-13 22:40 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 0:15
Septimus Hedgehog4-Sep-13 0:15 
QuestionSubstring / Split String help Pin
Member 101198373-Sep-13 5:02
Member 101198373-Sep-13 5:02 
AnswerRe: Substring / Split String help Pin
Dave Kreskowiak3-Sep-13 5:30
mveDave Kreskowiak3-Sep-13 5:30 
GeneralRe: Substring / Split String help Pin
Member 101198373-Sep-13 5:39
Member 101198373-Sep-13 5:39 
GeneralRe: Substring / Split String help Pin
Dave Kreskowiak3-Sep-13 5:47
mveDave Kreskowiak3-Sep-13 5:47 
AnswerRe: Substring / Split String help Pin
BillWoodruff3-Sep-13 17:46
professionalBillWoodruff3-Sep-13 17:46 
AnswerRe: Substring / Split String help Pin
Forbiddenx4-Sep-13 4:59
Forbiddenx4-Sep-13 4:59 
Question"Handle" Pin
Bernhard Hiller3-Sep-13 3:07
Bernhard Hiller3-Sep-13 3:07 
AnswerRe: "Handle" Pin
Dave Kreskowiak3-Sep-13 3:49
mveDave Kreskowiak3-Sep-13 3:49 
GeneralRe: "Handle" Pin
Bernhard Hiller3-Sep-13 21:43
Bernhard Hiller3-Sep-13 21:43 
GeneralRe: "Handle" Pin
Dave Kreskowiak4-Sep-13 1:16
mveDave Kreskowiak4-Sep-13 1:16 

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.