MultiCastDelegate vs Delegate

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

    MultiCastDelegate vs Delegate

    The documentation for the Delegate and the MultiCastDelega te classes tell me
    that when we have a line like:

    public delegate void CheckAndPrintDe legate(string str);

    it causes the compiler to generate a new delegate class named
    CheckAndPrintDe legate that inherits from System.Multicas tDelegate.

    Elsewhere it says a the same delegate definition produces a delegate class
    inheriting from System.Delegate .

    Under what condition does this construct create an instance of
    System.Delegate and under what condition does it create an instance of
    System.Multicas tDelegate?

    Thanks

    Nima Dilmaghani



  • Mattias Sjögren

    #2
    Re: MultiCastDelega te vs Delegate

    [color=blue]
    >it causes the compiler to generate a new delegate class named
    >CheckAndPrintD elegate that inherits from System.Multicas tDelegate.
    >
    >Elsewhere it says a the same delegate definition produces a delegate class
    >inheriting from System.Delegate .[/color]

    Well the delegate's immediate base class is MulticastDelega te, but
    that in turn inherits from Delegate so you could argue that both
    statements are true.



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    Working...