Design Time Support for EventHandler

Discussion in 'ASP .Net Building Controls' started by wolfgang, Jul 11, 2008.

  1. wolfgang

    wolfgang Guest

    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.
    wolfgang, Jul 11, 2008
    #1
    1. Advertising

  2. wolfgang

    Teemu Keiski Guest

    Hi,

    it should also have "event" keyword:

    public event EventHandler MyEvent;

    --
    Teemu Keiski
    AspInsider, ASP.NET MVP
    http://blogs.aspadvice.com/joteke
    http://teemukeiski.net


    "wolfgang" <> wrote in message
    news:...
    >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.
    Teemu Keiski, Jul 13, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jacob

    Dynamic eventhandler

    Jacob, Feb 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,623
    Eugene Jenihov
    Feb 5, 2004
  2. =?Utf-8?B?QWxlc3NhbmRybyBSb3NzaQ==?=

    Add an eventhandler on a button_click

    =?Utf-8?B?QWxlc3NhbmRybyBSb3NzaQ==?=, Feb 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    472
    Chris Jackson
    Feb 17, 2004
  3. =?Utf-8?B?SiBNY0Q=?=

    EventHandler problem

    =?Utf-8?B?SiBNY0Q=?=, Feb 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    340
    =?Utf-8?B?SiBNY0Q=?=
    Feb 22, 2004
  4. Karl
    Replies:
    0
    Views:
    523
  5. flamesrock
    Replies:
    8
    Views:
    449
    Hendrik van Rooyen
    Nov 24, 2006
Loading...

Share This Page