Yep - equivalent to this:
EnqueCallback(delegate() { Assert.AreEqual(9, thing.Value) });
If you had a parameter in the delegate, like this:
EnqueCallback(delegate(bool parameter) { Assert.AreEqual(9,
thing.Value) });
Then you could write it as a lamda like this:
EnqueCallback((parameter) => Assert.AreEqual(9, thing.Value));
But in this case there are no parameters ... hence the empty parentheses.
Thanks,
Tatham Oddie
call:+61414275989, call:+61280113982, skype:tathamoddie,
msn:[email protected]
Check out my business: Tixi - Ticketing without the dramas
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Sam Lai
Sent: Sunday, 15 March 2009 9:12 PM
To: [email protected]
Subject: Re: What's this mean? () =>
It's only 12pm and your mind is already in the gutter, tsk tsk.
I believe it means an anonymous lambda function taking no parameters
(otherwise there would be parameter variable names within the
brackets).
On 3/16/09, Stephen Price <[email protected]> wrote:
> Hi all,
> I'm pretty sure this looks like a linq lamba expression but Google won't
let
> me search it so was wondering if anyone could point me to an explanation
of
> what () => means.
>
> To put it in context, I'm looking at the Silverlight unit testing
framework
> and there are lines like;
>
> EnqueCallback(() => Assert.AreEqual(9, thing.Value));
>
> Or is it something to do with an anonymous delegate?
> I'm not having any problems with it, its working, but was just wondering
> what it means. :)
>
> thanks,
> Stephen
> p.s. Yes, () => looks like it could be a rude emoticon. :p
>
----------------------------------------------------------------------------
----
> Support procedure: https://www.codify.com/lists/support
> List address: [email protected]
> Subscribe: [email protected]
> Unsubscribe: [email protected]
> List FAQ: http://www.codify.com/lists/ozsilverlight
> Other lists you might want to join: http://www.codify.com/lists
>
>
--
Sent from my mobile device
----------------------------------------------------------------------------
----
Support procedure: https://www.codify.com/lists/support
List address: [email protected]
Subscribe: [email protected]
Unsubscribe: [email protected]
List FAQ: http://www.codify.com/lists/ozsilverlight
Other lists you might want to join: http://www.codify.com/lists
--------------------------------------------------------------------------------
Support procedure: https://www.codify.com/lists/support
List address: [email protected]
Subscribe: [email protected]
Unsubscribe: [email protected]
List FAQ: http://www.codify.com/lists/ozsilverlight
Other lists you might want to join: http://www.codify.com/lists