I am trying to assign a delegate to a method that belongs to another class object.
TestingClass testObj = new TestingClass();
Delegate myDelegate = testObj.testMethod; //syntax error
My intention is to point myDelegate to the method testMethod in testObj. The above code has syntax error.
What is the right syntax to do this in C#?
If you’re really intent on using delegates–which can be handy for creating a well-named type–define one of your own: