Sort of (if this answers your question).
You can use the using directive.
using obj1 = namespace1.class1;
then you can call
obj1.method1()
Or if you mean an actual indirection you can create a delegate with the same prototype as the method -
public delegate void method1delegate();
Then create an instance of the delegate -
public class Test {
method1delegate myMethod1Delegate;
}
Then you can instantiate it as such -
myMethod1Delegate = new method1delegate(namespace1.class1.method1)
And you can call your function by -
myMethod1Delegate();
Sorry if this isn't the cleanest example, but basically what you would use is the using directive or a delegate.
|