howto method reference
Posted: Tue Apr 01, 2008 7:41 am
Hi,
I recently discovered Cobra and I found it very interesting although I am not very
familiar with .NET
I am trying to do some tests and I want to pass to a method a reference
to another method.
The objective is to do smething like that :
class MyClass
def method1(m)
...
if method1 <> nil
method1()
...
MyClass().method1(ref ob.other_method)
I know this latter example does not work since m is declared as dynamic
and there is a conversion problem.
I tried to use the MethodInfo class without sucess.
Can you help me for this general purpose ?
Thanks.
I recently discovered Cobra and I found it very interesting although I am not very
familiar with .NET
I am trying to do some tests and I want to pass to a method a reference
to another method.
The objective is to do smething like that :
class MyClass
def method1(m)
...
if method1 <> nil
method1()
...
MyClass().method1(ref ob.other_method)
I know this latter example does not work since m is declared as dynamic
and there is a conversion problem.
I tried to use the MethodInfo class without sucess.
Can you help me for this general purpose ?
Thanks.