views:

77

answers:

1

Hello. I have the following code on a control of my own:

MethodInvoker _mi;
public MethodInvoker MI { get { return _mi; } set { _mi = value; } }

I thought the IDE would recognize this delegate, and allow me to choose a suitable already implemented function or create a new one if I wanted, just like it does to events, although at least at first glance, that does not seem to be the case. Is there a way to set a function to a delegate through the IDE?

+1  A: 

no there is not, use event if you want to use that feature

ArsenMkrt
Exactly, this is misusing a plain delegate.
Dykam
Why? Events can't return values.
devoured elysium
You know that when exposing Delegates in any way, you can use += and -=, you just can't control the add and event. Magic...
Dykam
I don't understand why it invalidates what I am saying. You can do _mi = something, so you should also be able to set a suitable delegate through the IDE.
devoured elysium