Answer the question
In order to leave comments, you need to log in
Why can't object methods be called through the delegate's Target property?
If there is a delegate that has been assigned some non-static object method:
SomeClass someObject = new SomeClass();
SomeDelegate someDelegate = someObject.SomeNonStaticMethod;
Console.WriteLine(someDelegate.Target == someObject);
someObject.SomeMethod();
someDelegate.Target.SomeMethod(); // а вот так почему-то нельзя
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question