471,610 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

Invisible Event

Hi,

I have created a custom component in c#, and I have added a new event to it.

I have a problem however in getting the event to show in the event list
in the properties window.

I have declared the event as follows:

public delegate void DownChangeDelegate(object sender, bool DownState);
public event DownChangeDelegate DownChanged;
I'm sure I must be missing something in order to make this visible, but
I've searched all over and everything I can find on events doesn't
mention anything about this.
Any help greatly appreciated.

Thanks.

Paul Cheetham
Jan 4 '06 #1
2 1088
Paul,

Have you recompiled your code? This might be it. I imagine you already
have, but it's worth a shot.

There are a few things to note about what you did with the DownState
parameter:

- It should be cased in camel case to conform to the public naming
conventions.
- It should be named "e" to conform with the existing event pattern already
established.
- It should be a type derived from EventArgs which exposes a property
DownState, which will return the value of whether or not the state is set or
not.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Paul Cheetham" <PA******@dsl.pipex.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I have created a custom component in c#, and I have added a new event to
it.

I have a problem however in getting the event to show in the event list in
the properties window.

I have declared the event as follows:

public delegate void DownChangeDelegate(object sender, bool DownState);
public event DownChangeDelegate DownChanged;
I'm sure I must be missing something in order to make this visible, but
I've searched all over and everything I can find on events doesn't mention
anything about this.
Any help greatly appreciated.

Thanks.

Paul Cheetham

Jan 4 '06 #2

Hi Nicholas,

Yes I have re-built my code several times - still nothing.

I can change the argument passing, but this shouldn't prevent it from
working should it?

Thankyou.
Paul

Nicholas Paldino [.NET/C# MVP] wrote:
Paul,

Have you recompiled your code? This might be it. I imagine you already
have, but it's worth a shot.

There are a few things to note about what you did with the DownState
parameter:

- It should be cased in camel case to conform to the public naming
conventions.
- It should be named "e" to conform with the existing event pattern already
established.
- It should be a type derived from EventArgs which exposes a property
DownState, which will return the value of whether or not the state is set or
not.

Hope this helps.

Jan 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Martin | last post: by
4 posts views Thread by Miguel Dias Moura | last post: by
11 posts views Thread by Jo | last post: by
2 posts views Thread by Arnaud Diederen | last post: by
1 post views Thread by shapper | last post: by
2 posts views Thread by ssailor | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.