Click here to Skip to main content
15,920,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: Milla Seconds in DateTime.Now Pin
StealthyMark26-Jul-03 14:14
StealthyMark26-Jul-03 14:14 
Generalgetting the name of a passed parameter Pin
Rbledwards25-Jul-03 11:42
Rbledwards25-Jul-03 11:42 
I have a reporting interface that generates 100 or so reports. Each report uses a varying combination of 11 total parameters (from 0 - 4 at most). So I could have:

Report report = new Report(StartDate, EndDate, NameID, LocID) //or just
Report(StartDate, NameID) //or
Report()

My problem is: how do I get my constructor to accept the parameters and know which ones were passed without overloading it a gillion times. Is there a way to a generic type parameter and get the actual name of the parameter passed? If I have the name of the parameter I can cast to the right type. I could even create a hashtable with all my parameter names, types and build my AddParameter method off of the parameter name.

Actually If I can get the name of the parameter, and I know the most that will be passed is four, five constructors and be good to go...I think.

Is this possible?

Robert
GeneralRe: getting the name of a passed parameter Pin
albean25-Jul-03 11:48
albean25-Jul-03 11:48 
GeneralRe: getting the name of a passed parameter Pin
Rbledwards25-Jul-03 12:25
Rbledwards25-Jul-03 12:25 
GeneralRe: getting the name of a passed parameter Pin
Daniel Turini25-Jul-03 11:49
Daniel Turini25-Jul-03 11:49 
GeneralRe: getting the name of a passed parameter Pin
Jim Stewart25-Jul-03 11:54
Jim Stewart25-Jul-03 11:54 
GeneralRe: getting the name of a passed parameter Pin
Rbledwards25-Jul-03 12:26
Rbledwards25-Jul-03 12:26 
GeneralUpdating Listbox Items Pin
monrobot1325-Jul-03 10:37
monrobot1325-Jul-03 10:37 
GeneralRe: Updating Listbox Items Pin
albean25-Jul-03 11:37
albean25-Jul-03 11:37 
GeneralRe: Updating Listbox Items Pin
monrobot1326-Jul-03 6:21
monrobot1326-Jul-03 6:21 
GeneralRe: Updating Listbox Items Pin
StealthyMark28-Jul-03 0:06
StealthyMark28-Jul-03 0:06 
Questionequivalent of this.DoEvents() ???? Pin
LongRange.Shooter25-Jul-03 10:33
LongRange.Shooter25-Jul-03 10:33 
AnswerRe: equivalent of this.DoEvents() ???? Pin
J. Dunlap25-Jul-03 10:43
J. Dunlap25-Jul-03 10:43 
GeneralRe: equivalent of this.DoEvents() ???? Pin
LongRange.Shooter26-Jul-03 3:21
LongRange.Shooter26-Jul-03 3:21 
GeneralRe: equivalent of this.DoEvents() ???? Pin
J. Dunlap26-Jul-03 11:51
J. Dunlap26-Jul-03 11:51 
GeneralMessageBoxIcon Pin
albean25-Jul-03 9:37
albean25-Jul-03 9:37 
GeneralRe: MessageBoxIcon Pin
Alex Korchemniy25-Jul-03 9:50
Alex Korchemniy25-Jul-03 9:50 
GeneralRe: MessageBoxIcon Pin
dynamic25-Jul-03 9:50
dynamic25-Jul-03 9:50 
GeneralRe: MessageBoxIcon Pin
Kastro25-Jul-03 9:52
Kastro25-Jul-03 9:52 
QuestionGet/set method for an array? Pin
frogb0x25-Jul-03 9:35
frogb0x25-Jul-03 9:35 
AnswerRe: Get/set method for an array? Pin
Alex Korchemniy25-Jul-03 9:54
Alex Korchemniy25-Jul-03 9:54 
GeneralRe: Get/set method for an array? Pin
frogb0x25-Jul-03 10:00
frogb0x25-Jul-03 10:00 
AnswerRe: Get/set method for an array? Pin
Kastro25-Jul-03 10:00
Kastro25-Jul-03 10:00 
GeneralSystem.Drawing from web Pin
Steve McLenithan25-Jul-03 9:19
Steve McLenithan25-Jul-03 9:19 
GeneralRe: System.Drawing from web Pin
dynamic25-Jul-03 9:28
dynamic25-Jul-03 9:28 

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.