Click here to Skip to main content
15,908,455 members
Home / Discussions / C#
   

C#

 
GeneralRe: Conditional RunTime code Pin
OriginalGriff10-Sep-15 5:49
mveOriginalGriff10-Sep-15 5:49 
It's not nice - if you have to use a static, it's probably a bad design! Laugh | :laugh:
And what happens if you have multiple threads, now or in the future? The approach fails, perhaps very badly.

Instead, I'd provide an optional paramater:
C#
public void MyMethod(...list of parameters..., bool fullMethod = false)
   {
   }
And then only call it with the full version when I needed it.

Why are you trying to do this? It sounds as if you have control of the calling and called ends, so why do you need to complicate things this much?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: Conditional RunTime code Pin
Eddy Vluggen11-Sep-15 10:56
professionalEddy Vluggen11-Sep-15 10:56 
GeneralRe: Conditional RunTime code Pin
David A. Gray11-Sep-15 11:26
David A. Gray11-Sep-15 11:26 
AnswerRe: Conditional RunTime code Pin
Eddy Vluggen10-Sep-15 5:41
professionalEddy Vluggen10-Sep-15 5:41 
GeneralRe: Conditional RunTime code Pin
NJdotnetdev10-Sep-15 5:45
NJdotnetdev10-Sep-15 5:45 
GeneralRe: Conditional RunTime code Pin
Eddy Vluggen10-Sep-15 5:54
professionalEddy Vluggen10-Sep-15 5:54 
QuestionNew to programming--Help! Pin
Member 119729959-Sep-15 20:13
Member 119729959-Sep-15 20:13 
AnswerRe: New to programming--Help! Pin
OriginalGriff9-Sep-15 21:09
mveOriginalGriff9-Sep-15 21:09 
AnswerRe: New to programming--Help! Pin
Richard MacCutchan9-Sep-15 22:10
mveRichard MacCutchan9-Sep-15 22:10 
AnswerRe: New to programming--Help! Pin
F-ES Sitecore9-Sep-15 23:42
professionalF-ES Sitecore9-Sep-15 23:42 
AnswerRe: New to programming--Help! Pin
Afzaal Ahmad Zeeshan10-Sep-15 1:06
professionalAfzaal Ahmad Zeeshan10-Sep-15 1:06 
AnswerRe: New to programming--Help! Pin
Amarnath S10-Sep-15 1:56
professionalAmarnath S10-Sep-15 1:56 
Questionmaking an array of List Pin
sdecorme9-Sep-15 3:53
sdecorme9-Sep-15 3:53 
AnswerRe: making an array of List Pin
OriginalGriff9-Sep-15 4:17
mveOriginalGriff9-Sep-15 4:17 
AnswerRe: making an array of List Pin
Eddy Vluggen9-Sep-15 11:24
professionalEddy Vluggen9-Sep-15 11:24 
QuestionSecondary Y-Axis not displayed in graph using c sharp Pin
santosh kumar dash9-Sep-15 2:10
santosh kumar dash9-Sep-15 2:10 
AnswerRe: Secondary Y-Axis not displayed in graph using c sharp Pin
Eddy Vluggen9-Sep-15 3:44
professionalEddy Vluggen9-Sep-15 3:44 
GeneralRe: Secondary Y-Axis not displayed in graph using c sharp Pin
santosh kumar dash10-Sep-15 0:16
santosh kumar dash10-Sep-15 0:16 
Questioncalling T's method from a generic class Pin
binsafir7-Sep-15 23:36
binsafir7-Sep-15 23:36 
AnswerRe: calling T's method from a generic class Pin
Eddy Vluggen7-Sep-15 23:57
professionalEddy Vluggen7-Sep-15 23:57 
AnswerRe: calling T's method from a generic class Pin
Richard MacCutchan7-Sep-15 23:59
mveRichard MacCutchan7-Sep-15 23:59 
AnswerRe: calling T's method from a generic class Pin
Pete O'Hanlon8-Sep-15 0:07
mvePete O'Hanlon8-Sep-15 0:07 
AnswerRe: calling T's method from a generic class Pin
F-ES Sitecore8-Sep-15 0:24
professionalF-ES Sitecore8-Sep-15 0:24 
AnswerRe: calling T's method from a generic class Pin
DanBecause9-Sep-15 18:03
DanBecause9-Sep-15 18:03 
GeneralRe: calling T's method from a generic class Pin
David A. Gray11-Sep-15 11:33
David A. Gray11-Sep-15 11:33 

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.