P
Philipp Ott
Hello!
I would like to send a method based on a string to an object.
In Smalltalk, Ruby and Objective-C exists a respondsto: method which allows you to ask an object dynamically if it responds to a certain method and also to invoke the method with some parameters.
Is there such a functionality in C#? I get a string with a methodname and would like to check if an object has the method "amethod:". If so then I would like to send this message to the object and pass some parameters along.
Does this work in C#?
Can I get a runtime-list of methods supported from an object and iterate myself through the list and compare with the string and invoke the method then?
Thank you for any help,
regards
Philipp Ott
I would like to send a method based on a string to an object.
In Smalltalk, Ruby and Objective-C exists a respondsto: method which allows you to ask an object dynamically if it responds to a certain method and also to invoke the method with some parameters.
Is there such a functionality in C#? I get a string with a methodname and would like to check if an object has the method "amethod:". If so then I would like to send this message to the object and pass some parameters along.
Does this work in C#?
Can I get a runtime-list of methods supported from an object and iterate myself through the list and compare with the string and invoke the method then?
Thank you for any help,
regards
Philipp Ott