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. Advertisements

  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. Advertisements

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. Zviki Goldberg

    Design Time Support

    Zviki Goldberg, Apr 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    459
    Zviki Goldberg
    Apr 19, 2004
  2. =?Utf-8?B?amlt?=
    Replies:
    4
    Views:
    3,046
    =?Utf-8?B?amlt?=
    Nov 30, 2004
  3. Christian H

    WebUserControl and design time support

    Christian H, Sep 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    517
    Christian H
    Sep 30, 2005
  4. onyxring
    Replies:
    0
    Views:
    590
    onyxring
    Feb 15, 2006
  5. Replies:
    0
    Views:
    511
  6. =?Utf-8?B?U2ltb24=?=

    Custom Control - Design Time Support

    =?Utf-8?B?U2ltb24=?=, Jan 24, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    453
    =?Utf-8?B?U2ltb24=?=
    Jan 24, 2007
  7. Mark Olbert
    Replies:
    1
    Views:
    623
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 17, 2007
  8. flamesrock
    Replies:
    8
    Views:
    801
    Hendrik van Rooyen
    Nov 24, 2006
Loading...