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

C#

 
QuestionHow to Merge Child toolbar with parent Toolbar? Pin
Anonymous15-Nov-03 18:03
Anonymous15-Nov-03 18:03 
QuestionHow Can I add a backgroudimage to toolbar Pin
lupa_842115-Nov-03 15:21
lupa_842115-Nov-03 15:21 
AnswerRe: How Can I add a backgroudimage to toolbar Pin
Heath Stewart15-Nov-03 17:45
protectorHeath Stewart15-Nov-03 17:45 
QuestionHow To use WebRequest to POST Data to web server Pin
Scott_Lee_Wing15-Nov-03 5:59
Scott_Lee_Wing15-Nov-03 5:59 
AnswerRe: How To use WebRequest to POST Data to web server Pin
Heath Stewart15-Nov-03 6:51
protectorHeath Stewart15-Nov-03 6:51 
AnswerRe: How To use WebRequest to POST Data to web server Pin
Arjan Einbu16-Nov-03 3:36
Arjan Einbu16-Nov-03 3:36 
GeneralCalling subs by name Pin
krzysztofo@poczta.onet.pl15-Nov-03 1:16
susskrzysztofo@poczta.onet.pl15-Nov-03 1:16 
GeneralRe: Calling subs by name Pin
Heath Stewart15-Nov-03 4:50
protectorHeath Stewart15-Nov-03 4:50 
Read-up on .NET Reflection. You can do this but you'll need to know a class on which these "functions" (technically, "methods" when talked about in OOP) are attached. For example, if the various methods are on the class that reads this file, when the parsing method comes to that delimited field it could do something like this:
MethodInfo method = this.GetType().GetMethod("ValidateDate",
  BindingFlags.IgnoreCase | BindingFlags.NonPublic | BindingFlags.Public);
if (method != null) method.Invoke(this, null);
Of course, you'll want to use a variable for the method name in the call to GetMethod, but this is the idea. You can also play around with the BindingFlags to get what you want.

You could also have a class with nothing more than validation functions and get its Type in order to call these methods. If you want static methods, that is possible with the BindingFlags too. Just read the documentation about the various classes, methods, and enums I used and read-up in Reflection.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Calling subs by name Pin
Kris{PL}16-Nov-03 0:41
Kris{PL}16-Nov-03 0:41 
GeneralC# networking problem Pin
Anonymous15-Nov-03 0:40
Anonymous15-Nov-03 0:40 
GeneralRe: C# networking problem Pin
mhmoud rawas15-Nov-03 18:55
mhmoud rawas15-Nov-03 18:55 
GeneralRe: C# networking problem Pin
Anonymous15-Nov-03 23:17
Anonymous15-Nov-03 23:17 
GeneralRe: C# networking problem Pin
badro16-Nov-03 1:27
badro16-Nov-03 1:27 
GeneralRe: C# networking problem Pin
Anonymous16-Nov-03 2:40
Anonymous16-Nov-03 2:40 
GeneralDynamic Type Retrieval - Help! Pin
J. Dunlap14-Nov-03 12:13
J. Dunlap14-Nov-03 12:13 
GeneralRe: Dynamic Type Retrieval - Help! Pin
leppie14-Nov-03 22:07
leppie14-Nov-03 22:07 
GeneralRe: Dynamic Type Retrieval - Help! Pin
J. Dunlap14-Nov-03 22:14
J. Dunlap14-Nov-03 22:14 
GeneralRe: Dynamic Type Retrieval - Help! Pin
leppie14-Nov-03 22:34
leppie14-Nov-03 22:34 
GeneralCrystal reports interaction.. Pin
mohammad_mostafa14-Nov-03 10:59
mohammad_mostafa14-Nov-03 10:59 
GeneralLicense and distribution Pin
zhoulhh14-Nov-03 9:32
zhoulhh14-Nov-03 9:32 
GeneralRe: License and distribution Pin
Heath Stewart15-Nov-03 4:53
protectorHeath Stewart15-Nov-03 4:53 
GeneralKeyboard Hook Pin
trendb14-Nov-03 8:08
trendb14-Nov-03 8:08 
Generalweird string question Pin
RB@Emphasys14-Nov-03 4:52
RB@Emphasys14-Nov-03 4:52 
GeneralRe: weird string question Pin
Daniel M. Edwards14-Nov-03 5:43
Daniel M. Edwards14-Nov-03 5:43 
GeneralRe: weird string question Pin
Mike Ellison14-Nov-03 20:07
Mike Ellison14-Nov-03 20:07 

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.