mismatch in events

S

Sonnich Jensen

Hi

I am developing a component, and during the process I have updated some events:


public delegate void eventPopup(object Sender, int SeriesNumber, int ChildNumber, ref List<string> MenuItems);
public event eventPopup OnPopup;

the ref menuitems is new

Now, when using the component, it ALWAYS want to create

private void comp_OnPopup(object Sender, int SeriesNumber, int ChildNumber)
{

}


Without the last variable (the ref'd menu items

So my guess is that it cashes something badly and never let go of it.

Any ideas?

WBR
Sonnich
 
J

Jeff Johnson

I am developing a component, and during the process I have updated some
events:


public delegate void eventPopup(object Sender, int SeriesNumber, int
ChildNumber, ref List<string> MenuItems);
public event eventPopup OnPopup;

the ref menuitems is new

Now, when using the component, it ALWAYS want to create

private void comp_OnPopup(object Sender, int SeriesNumber, int
ChildNumber)
{

}


Without the last variable (the ref'd menu items

So my guess is that it cashes something badly and never let go of it.

Any ideas?

My main idea is that you should stick to the event paradigm that 99.999999%
of developers are using, that being the signature of your delegate should be
(object sender, [SomeClassDerivingFromEventArgs] e), instead of the multiple
parameters you're currently passing. Make those parameters properties of
your EventArgs derivative.

As for the component, you're probably going to have to make sure you rebuild
it and then perhaps close and open all designer (and code?) windows that
reference it. Restarting the IDE may be needed as a worst-case scenario. You
shouldn't have to reboot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top