would someone please write this code:
this.Loaded += (s, e) => this.loaded = true;
into several code lines so I can retrace the meaning?
In my code sample there is no s or e ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This may make it slightly clearer, just by renaming:
Or by giving them types:
They’re the parameters for the delegate. Here’s the equivalent in C# 2:
Does that help?
Here’s the equivalent in C# 1 (fortunately there are no captured variables, which makes life a bit easier…)
(That’s all assuming the
Loadedevent is of type EventHandler; if it’s not, the signature would be different in the obvious way.)