Avatar of Tom Knowlton
Tom Knowlton
Flag for United States of America asked on

Question about this bit of C# syntax...

Not familiar with this syntax.

What does this line of code do?  What is (s, e)?  Looks like some sort of initialization for a collection of events?

public event EventHandler LoadingItemsStarted = (s, e) => { };

Open in new window

.NET ProgrammingC#* LINQ

Avatar of undefined
Last Comment
Tom Knowlton

8/22/2022 - Mon
Chinmay Patel

Hi Tom,

Those are lambda expressions i.e. Anonymous functions.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions

Regards,
Chinmay.
Chinmay Patel

And s and e are the parameters for whatever you are going to put between the following curly braces.
ASKER CERTIFIED SOLUTION
it_saige

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Tom Knowlton

ASKER
Okay.

Thank you!
Your help has saved me hundreds of hours of internet surfing.
fblack61
Tom Knowlton

ASKER
Thank you!