Delegates and Events: C#, Net 4.0

by Ajay Yadav
Oct. 7, 2017 0 comments INFOSEC Institute

In this article, you will learn how to create and manipulates Delegate types as well as C# events, which streamline the process of working with delegates types. Delegates provide a mechanism for defining and executing callbacks. Their flexibility allows you to define the exact signature of the callback, and that information becomes part of the delegate type itself. Delegates are type-safe, object-oriented and secure which reduce the common problems associated with using function pointers. Delegates Overview A Delegate is an abstraction of one or more function pointers. The .NET has implemented the concept of function pointer in form delegate .With delegates, you can treat a function as data. Delegates allow functions to be passed as parameters, returned from a function as a value, and stored in an array. The delegate has following characteristics.