[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

Design Time Support for EventHandler

wolfgang

7/11/2008 7:03:00 AM

I implemented an event in a class as described in the Visual Studio
2008 documentation:

public EventHandler MyEvent;
protected virtual void OnMyEvent(EventArgs e)
{
if (MyEvent!= null) MyEvent(this, e);
}

The event works as expected but Intellisense doesn't recognise it as
eventhandler. MyEvent shows up as a public variable with a blue box
icon. Therefore I can't create an eventhandler template pressing the
<TAB>-key after the += as with the builtin events like Load.

Surely some design time support attributes or code is missing but I
wasn't able to find any information on how to tell Intellisense that
MyEvent is an eventhandler.
1 Answer

Teemu Keiski

7/13/2008 4:15:00 PM

0

Hi,

it should also have "event" keyword:

public event EventHandler MyEvent;

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice....
http://teemu...


"wolfgang" <neff1423@gmail.com> wrote in message
news:69dc7b17-0a29-4789-965a-9310b12a925a@m73g2000hsh.googlegroups.com...
>I implemented an event in a class as described in the Visual Studio
> 2008 documentation:
>
> public EventHandler MyEvent;
> protected virtual void OnMyEvent(EventArgs e)
> {
> if (MyEvent!= null) MyEvent(this, e);
> }
>
> The event works as expected but Intellisense doesn't recognise it as
> eventhandler. MyEvent shows up as a public variable with a blue box
> icon. Therefore I can't create an eventhandler template pressing the
> <TAB>-key after the += as with the builtin events like Load.
>
> Surely some design time support attributes or code is missing but I
> wasn't able to find any information on how to tell Intellisense that
> MyEvent is an eventhandler.