Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
QuestionReflection - from Type to Class (not instance of class) Pin
devvvy4-Dec-18 13:51
devvvy4-Dec-18 13:51 
AnswerRe: Reflection - from Type to Class (not instance of class) Pin
OriginalGriff4-Dec-18 21:31
mveOriginalGriff4-Dec-18 21:31 
AnswerRe: Reflection - from Type to Class (not instance of class) Pin
F-ES Sitecore5-Dec-18 1:02
professionalF-ES Sitecore5-Dec-18 1:02 
AnswerRe: Reflection - from Type to Class (not instance of class) Pin
Richard Deeming5-Dec-18 9:09
mveRichard Deeming5-Dec-18 9:09 
QuestionCode refactoring.. Pin
Simon_Whale4-Dec-18 2:49
Simon_Whale4-Dec-18 2:49 
AnswerRe: Code refactoring.. Pin
dan!sh 4-Dec-18 3:29
professional dan!sh 4-Dec-18 3:29 
AnswerRe: Code refactoring.. Pin
Gerry Schmitz4-Dec-18 8:06
mveGerry Schmitz4-Dec-18 8:06 
AnswerRe: Code refactoring.. Pin
Luc Pattyn4-Dec-18 21:53
sitebuilderLuc Pattyn4-Dec-18 21:53 
Hi,

as others already noted, every second call to MethodCall(param1, param2, param3), I mean the ones after the question marks, is likely to return true, as you just have tested for true (that is what the question mark does). I say likely, it might be ugly code that creates or uses nasty side effects. If so, what follows needs some adjusting.

it seems all your params have the same type, and all your someIntValues have different values, so I would suggest you:

1. stuff all the params in an array "paramsArray"
2. stuff all the someIntValues in an array "someIntValuesArray"
3. modify your MethodCall() to accept paramsArray and return an integer, being the first index in the paramsArray for which the original MethodCall() did return true; this basically means surrounding existing code with a for loop, adjusting the params (now array elements); also return a special value if no match found, say -1.
4. then simply do
int index=MethodCall(paramsArray);
if (index>=0) outcome=AnotherMethod(true, someIntValuesArray[index]);


Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

QuestionRdlc reporting page break doesnt work- URGENT Pin
Member 132642683-Dec-18 18:40
Member 132642683-Dec-18 18:40 
AnswerRe: Rdlc reporting page break doesnt work- URGENT Pin
Richard MacCutchan3-Dec-18 21:56
mveRichard MacCutchan3-Dec-18 21:56 
AnswerRe: Rdlc reporting page break doesnt work- URGENT Pin
OriginalGriff3-Dec-18 22:16
mveOriginalGriff3-Dec-18 22:16 
QuestionScan Barcode Get Product Image Pin
Kevin Marois2-Dec-18 12:02
professionalKevin Marois2-Dec-18 12:02 
AnswerRe: Scan Barcode Get Product Image Pin
Dave Kreskowiak2-Dec-18 16:27
mveDave Kreskowiak2-Dec-18 16:27 
AnswerRe: Scan Barcode Get Product Image Pin
OriginalGriff2-Dec-18 19:49
mveOriginalGriff2-Dec-18 19:49 
GeneralRe: Scan Barcode Get Product Image Pin
Kevin Marois3-Dec-18 6:43
professionalKevin Marois3-Dec-18 6:43 
QuestionWPF and C# - Passing Data and accessing Controls between Child Windows Pin
James Wyatt2-Dec-18 5:45
James Wyatt2-Dec-18 5:45 
AnswerRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
OriginalGriff2-Dec-18 5:58
mveOriginalGriff2-Dec-18 5:58 
GeneralRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
James Wyatt2-Dec-18 6:13
James Wyatt2-Dec-18 6:13 
GeneralRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
OriginalGriff2-Dec-18 6:27
mveOriginalGriff2-Dec-18 6:27 
GeneralRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
James Wyatt2-Dec-18 7:28
James Wyatt2-Dec-18 7:28 
GeneralRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
Pete O'Hanlon4-Dec-18 7:06
mvePete O'Hanlon4-Dec-18 7:06 
GeneralRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
Gerry Schmitz4-Dec-18 7:16
mveGerry Schmitz4-Dec-18 7:16 
GeneralRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
BillWoodruff5-Dec-18 14:49
professionalBillWoodruff5-Dec-18 14:49 
AnswerRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
Mycroft Holmes2-Dec-18 10:42
professionalMycroft Holmes2-Dec-18 10:42 
GeneralRe: WPF and C# - Passing Data and accessing Controls between Child Windows Pin
James Wyatt2-Dec-18 20:57
James Wyatt2-Dec-18 20:57 

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.