Events and Delegates in C# | Events and Delegates in CSharp with Examples
In this video, I am going to discuss the Roles of Events, Delegates, and Event Handler in C# with Real-Time Examples. At the end of this video, I am sure, you will understand what are Events, Delegates, and Event Handler in C# and the role and responsibilities of Events, Delegates, and Event Handlers in the .NET Framework.
Roles of Events, Delegates, EventArgs and Event Handler in C#
So, first, we will talk about the Role of Events, then we will talk about the Role of Delegates and finally, we will discuss the role of Event Handlers.
Role of Event in C#:
Events are an important part of the .NET Framework and you can find them throughout it. For example, when you click on a button, you can go to a dropdown list, and handle the selected index changed event. Another example might be in an Ecommerce Application, when a customer places an order, an event notification might be sent to notify other parts of the system that an order has been placed. And then they can work on that order to start the processing like shipping the order, billing the order, couriering the order, etc.
Role of Delegates in C#:
As a programmer, we need to understand the delegate concept very well and the .NET Framework uses this delegate concept very frequently, mostly when working with autogenerated code. In Fact, without delegates, the event would not be useful at all. And the reason is, we do not have other ways to transfer the event data from point A (Event Raiser) to point B (Event Handler). So, let us proceed and try to understand what are exactly delegates and why they are used in .NET Framework.
Roles of Event Handler in C#:
The final piece of Events and Delegates is Event Handler. Of course, if you work with .NET before, this won’t be a surprising thing to you. This is because, if you working with Windows Form or Web Form Application, and if you have a button and when you double click on it, it will generate an event handler for the click event of the button element.
The text document of this video: https://dotnettutorials.net/lesson/ev...
#eventscsharp #delegatescsharp #eventsdelegatescsharp #eventscsharpexample #delegatescsharpexample #eventsdelegatescsharpexample #csharp #dotnettutorials #csharptutorials
Events and Delegates
Events and Delegates in C#
Events and Delegates in C# with Examples
Events and Delegates in CSharp
Events and Delegates in CSharp with Examples
Events in C#
Events in C# with Examples
Events in CSharp
Events in CSharp with Examples
Delegates in C#
Delegates in C# with Examples
Delegates in CSharp
Delegates in CSharp with Examples
Roles of Events in C#
Roles of Delegates in C#
Roles of Event Handler in C#
Roles of Events in CSharp
Roles of Delegates in CSharp
Roles of Event Handler in CSharp