Assume that the target was not stored. What should invoking a delegate to an instance method do? An instance method cannot run without an object reference that is the current instance (the this
reference in C#). It is not possible to define a sensible behavior for this case.
An instance method can access instance fields. Without the this
reference these fields would be inaccessible.
If you do not want to store the target, wrap the instance method in a static function:
MyCustomClass obj = new MyCustomClass();
Action withTarget = obj.SomeMethod; //stores target
static void MyCustomInvoker(MyCustomClass obj) {
obj.SomeMethod();
}
Action<MyCustomClass> noTarget = MyCustomInvoker; //does not store any target