Skip to content
0:00 / 0:00

#c##events#delegates

What does the event keyword in C# actually do?

Scott Steffes

3.2K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.

Intermediate. Assumes working knowledge.

5.5K views5 years ago1 recommendation

Programming languagesC# and .NET

Scott Steffes explains how the event keyword in C# modifies the delegate system rather than introducing complex magic.

Going over what the event keyword in C# actually does. Code: gist.github.com/markv12/820554cceb900a782400f4149459b9ee It might seem like the event keyword does a bunch of magic, but it actually only slightly modifies the existing function delegate system.

Why it's here

1 person recommends this

What people say. Recommended as a clear explanation of how C# events and delegates work under the hood.

u/markv12in r/dotnet • Recommends

I had always assumed there was a lot of magic behind C# events but they're actually really simple. Most of the functionality comes from function delegates and the event keyword is just the last piece of the puzzle. This video lays out exactly how they work and what all the syntax means.