bri189a Posted November 23, 2005 Posted November 23, 2005 Okay, I've read several articles about this. I don't see what the big deal is. Maybe it's the examples - don't seem to be accomplishing anything magic that you couldn't do with delegates as they are in 1.1 - can anyone expand on what's the big deal is in a real world example? Quote
IngisKahn Posted November 23, 2005 Posted November 23, 2005 It's all about ease of use. If your delegate is only one or two statements then it's the way to go. Plus the ability to incorporate local variables makes it handy. One instance where I've used them is in a tranformation matrix control. You can translate, scale, and rotate the matrix in any order, so I just create an anonymous delegate for each step. Quote "Who is John Galt?"
Administrators PlausiblyDamp Posted November 23, 2005 Administrators Posted November 23, 2005 They can also make unit tests involving callbacks / events far cleaner to write as well. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Experts* Nerseus Posted November 23, 2005 *Experts* Posted November 23, 2005 Basically there's no "magic", just a convenience. Before someone had a one line if, all if's looked like: if (expression == true) { return true; } Someone said "hey, let's make it more convenient in certain circumstances": if (expression == true) return true; -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.