Re: event arguments
- From: "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 14 Nov 2005 22:41:46 -0500
> It seems odd to specify a convention which only becomes useful several
> years later though!
Bill Gates once said he couldn't imagine a computer needing more than 640 KB
of memory. I suppose Microsoft has learned that lesson. In spades!
--
;-),
Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1de2f14832fa2b7d98ca40@xxxxxxxxxxxxxxxxxxxxxxx
> Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote:
>
> <snip>
>
>> No, that doesn't work. Try this:
>>
>> using System;
>> using System.Windows.Forms;
>>
>> public class Test
>> {
>> static void Main(string[] args)
>> {
>> MouseEventHandler handler = new MouseEventHandler(Foo);
>> }
>>
>> static void Foo (object sender, EventArgs e)
>> {
>> }
>> }
>>
>> With 1.1, it doesn't compile. I can't remember whether it would in 2.0
>> - I seem to remember that there's some covariance changes, but
>> unfortunately I'm between beta and release at the moment, with nothing
>> actually installed to try it out on...
>
> Just tried this with 2.0 and it *does* work due to delegate covariance
> (or contravariance - I never get those two the right way round).
>
> It seems odd to specify a convention which only becomes useful several
> years later though!
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
.
- References:
- event arguments
- From: Pohihihi
- Re: event arguments
- From: Pete Davis
- event arguments
- Prev by Date: Re: DotNet is behind where we were with VB, about a dozen years ago
- Next by Date: Re: static variables?
- Previous by thread: Re: event arguments
- Next by thread: Re: event arguments
- Index(es):
Relevant Pages
|