Click here to Skip to main content
16,007,443 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help understanding SQL connections Pin
Colin Angus Mackay19-Sep-04 10:45
Colin Angus Mackay19-Sep-04 10:45 
GeneralRe: Need help understanding SQL connections Pin
Dam.NET19-Sep-04 11:04
Dam.NET19-Sep-04 11:04 
GeneralWinForms: Basic Document Handler implementation Pin
peterchen19-Sep-04 6:00
peterchen19-Sep-04 6:00 
GeneralRe: WinForms: Basic Document Handler implementation Pin
Alex Korchemniy19-Sep-04 12:04
Alex Korchemniy19-Sep-04 12:04 
GeneralZedgraph Pin
xiaowenjie19-Sep-04 4:37
xiaowenjie19-Sep-04 4:37 
GeneralRe: Zedgraph Pin
sreejith ss nair19-Sep-04 5:02
sreejith ss nair19-Sep-04 5:02 
Generalexecute a fuction Pin
meherkalyan18-Sep-04 19:59
meherkalyan18-Sep-04 19:59 
GeneralRe: execute a fuction Pin
mav.northwind18-Sep-04 23:53
mav.northwind18-Sep-04 23:53 
To accomplish this you'll have to use reflection to find the MethodInfo of the method you want to execute.
I'd suggest you read the documentation on the Type class, there are several overloaded GetMethod() methods that can give you a MethodInfo for a method name.
Once you have the correct MethodInfo you call one of it's Invoke() methods to actually execute the target method.
Arguments for this method are supplied in the form of an object array, if any.

One thing you'll have to keep in mind: You can't just "apply a function", you always need an object to execute one of it's methods (it's a parameter for MethodInfo.Invoke()).

This code fragment should help:
MyObject obj = new MyObject();
MethodInfo mi = obj.GetType().GetMethod(func);
object[] arguments = new object[] { "arg1", 42 };
object result = mi.Invoke(obj, arguments);

Regards,
mav
GeneralBEFORE SHUT DOWN WINDOWS Pin
Zapss18-Sep-04 19:16
Zapss18-Sep-04 19:16 
GeneralRe: BEFORE SHUT DOWN WINDOWS Pin
mav.northwind18-Sep-04 23:40
mav.northwind18-Sep-04 23:40 
GeneralRe: BEFORE SHUT DOWN WINDOWS Pin
Zapss19-Sep-04 3:07
Zapss19-Sep-04 3:07 
GeneralDRAW N-sided polygon Pin
Your dog wants steak18-Sep-04 13:40
Your dog wants steak18-Sep-04 13:40 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay18-Sep-04 15:33
Colin Angus Mackay18-Sep-04 15:33 
GeneralRe: DRAW N-sided polygon Pin
Your dog wants steak18-Sep-04 16:20
Your dog wants steak18-Sep-04 16:20 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay18-Sep-04 16:43
Colin Angus Mackay18-Sep-04 16:43 
GeneralRe: DRAW N-sided polygon Pin
yoaz19-Sep-04 1:07
yoaz19-Sep-04 1:07 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay19-Sep-04 2:08
Colin Angus Mackay19-Sep-04 2:08 
GeneralRe: DRAW N-sided polygon Pin
yoaz19-Sep-04 4:41
yoaz19-Sep-04 4:41 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay19-Sep-04 4:57
Colin Angus Mackay19-Sep-04 4:57 
GeneralImage enlarging quality Pin
Kryal18-Sep-04 13:12
Kryal18-Sep-04 13:12 
GeneralRe: help in windows service Pin
Colin Angus Mackay18-Sep-04 15:25
Colin Angus Mackay18-Sep-04 15:25 
GeneralRe: help in windows service Pin
jacal9919-Sep-04 3:59
jacal9919-Sep-04 3:59 
GeneralRe: help in windows service Pin
Colin Angus Mackay19-Sep-04 4:08
Colin Angus Mackay19-Sep-04 4:08 
Generalmake setup Pin
fatidarya18-Sep-04 11:17
fatidarya18-Sep-04 11:17 
GeneralRe: make setup Pin
sreejith ss nair19-Sep-04 3:18
sreejith ss nair19-Sep-04 3:18 

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.