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

C#

 
AnswerRe: array of function Pin
N a v a n e e t h3-Feb-09 22:04
N a v a n e e t h3-Feb-09 22:04 
GeneralRe: array of function Pin
t_nedelchev3-Feb-09 22:23
t_nedelchev3-Feb-09 22:23 
GeneralRe: array of function Pin
User 66583-Feb-09 23:06
User 66583-Feb-09 23:06 
GeneralRe: array of function Pin
Ennis Ray Lynch, Jr.4-Feb-09 4:24
Ennis Ray Lynch, Jr.4-Feb-09 4:24 
AnswerRe: array of function Pin
PIEBALDconsult4-Feb-09 7:35
mvePIEBALDconsult4-Feb-09 7:35 
QuestionDynamically change method Pin
MAW303-Feb-09 21:13
MAW303-Feb-09 21:13 
AnswerRe: Dynamically change method Pin
Spunky Coder3-Feb-09 21:22
Spunky Coder3-Feb-09 21:22 
AnswerRe: Dynamically change method Pin
N a v a n e e t h3-Feb-09 21:45
N a v a n e e t h3-Feb-09 21:45 
Not sure I got your question correctly.

You define a interface something like
interface IVendor
{
    M GetM();
    N GetN();
    O GetO();
}
Now each of your vendor classes has to implement this interface. Maintain a configuration file where class names of all these vendors are stored. According to the dropdown value, get the relevant class name from configuration and invoke it using reflection. You can use Activator.CreateInstance[^] for this. Cast this object as IVendor and return. Now you can call required methods on this.

This will help you to add new vendors without recompiling the program.

Smile | :)


GeneralRe: Dynamically change method Pin
User 66584-Feb-09 0:23
User 66584-Feb-09 0:23 
AnswerRe: Dynamically change method Pin
PIEBALDconsult4-Feb-09 8:03
mvePIEBALDconsult4-Feb-09 8:03 
QuestionWindows Communication Foundation (setup.bat file configuration) Pin
AmbitiousBeginner3-Feb-09 20:48
AmbitiousBeginner3-Feb-09 20:48 
AnswerRe: Windows Communication Foundation (setup.bat file configuration) Pin
SeMartens3-Feb-09 21:54
SeMartens3-Feb-09 21:54 
GeneralRe: Windows Communication Foundation (setup.bat file configuration) Pin
AmbitiousBeginner3-Feb-09 22:22
AmbitiousBeginner3-Feb-09 22:22 
GeneralRe: Windows Communication Foundation (setup.bat file configuration) Pin
SeMartens3-Feb-09 22:35
SeMartens3-Feb-09 22:35 
Questionchanging mac address Pin
kralece3-Feb-09 20:25
kralece3-Feb-09 20:25 
AnswerRe: changing mac address Pin
Hristiyan3-Feb-09 21:44
Hristiyan3-Feb-09 21:44 
GeneralRe: changing mac address Pin
kralece4-Feb-09 23:44
kralece4-Feb-09 23:44 
Questionstring tokenize Pin
lawrenceinba3-Feb-09 20:01
lawrenceinba3-Feb-09 20:01 
AnswerRe: string tokenize Pin
Vikram A Punathambekar3-Feb-09 21:17
Vikram A Punathambekar3-Feb-09 21:17 
AnswerRe: string tokenize Pin
S.Dhanasekaran4-Feb-09 3:24
S.Dhanasekaran4-Feb-09 3:24 
QuestionRead CLI number Pin
M Riaz Bashir3-Feb-09 19:58
M Riaz Bashir3-Feb-09 19:58 
Questionsend and receive Bluetooth Pin
mrMattar3-Feb-09 19:46
mrMattar3-Feb-09 19:46 
AnswerRe: send and receive Bluetooth Pin
Christian Graus3-Feb-09 19:58
protectorChristian Graus3-Feb-09 19:58 
AnswerRe: send and receive Bluetooth Pin
Giorgi Dalakishvili3-Feb-09 20:19
mentorGiorgi Dalakishvili3-Feb-09 20:19 
QuestionDataGridView Pin
CodingYoshi3-Feb-09 18:32
CodingYoshi3-Feb-09 18:32 

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.