Define event in interface

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anthony Yott

    Define event in interface

    Anyone have an example of defining a custom event (i.e custom delegate) in an
    interface?
    --
    Anthony Yott
  • Shahzad Ahmed

    #2
    RE: Define event in interface

    you cant define delegates in interface as delegate is it self a type which is
    not permitted in interface.You must declare the delegate out side interface.
    This is in context of C# here u must provided delegate with the event
    declaration.

    public delegate void Y();
    interface i{
    event Y ev;
    }

    Vb.net allows you to define event in interface as the event declaration in
    vb.net doesnot requires delegate.

    Regards
    Shahzad

    "Anthony Yott" wrote:
    [color=blue]
    > Anyone have an example of defining a custom event (i.e custom delegate) in an
    > interface?
    > --
    > Anthony Yott[/color]

    Comment

    Working...