You noticed that throughout pretty much all the previous lessons where I discussed events, I have been using Action as the delegate type for the event. Obviously, you can use whatever delegate type you’d like, but in the vast majority of the cases, by convention (and only by convention!)… Read more
Posts Tagged ‘events’
EventHandler, sender and EventArgs
Friday, February 21st, 2020Events Add and Remove
Wednesday, February 19th, 2020In the previous lesson I showed you how the compiler actually implements events by actually adding two methods named addon() and removeon() in the background and making the Action field private, so we can’t invoke it. But that was done in MSIL language, and we really don’t need to deal with such a low level.… Read more
Events
Wednesday, February 5th, 2020Events are a more secure way of implementing the observer pattern described in the previous lesson, and they are the evolutionary step of raw delegates. You may have heard about the event-driven programming as a concept that describes a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs or threads.… Read more
Control Events
Sunday, September 3rd, 2017In computer programming, event-driven programming is a programming paradigm in which the flow of the execution of a program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs/threads.
Because C# is also an event-driven programming language, today we will learn about events.… Read more