edit lecture 11

main
borb 2 weeks ago
parent 8de92296c3
commit 92bb7c3cb9

@ -16,8 +16,9 @@ Events
# Delegates # Delegates
* __Delegates __ are reference type variables that hold a __reference to a method__ or multiple methods * [Delegates](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/) are reference type variables that hold a *__reference to a method__* or multiple methods
* Class objects hold a reference to a class instance, delegate objects hold a reference to a method / methods * Class objects hold a reference to a class instance
* Delegate objects hold a reference to a method / methods
* Similar to function pointers in C and C++, or how any function in JavaScript works * Similar to function pointers in C and C++, or how any function in JavaScript works
* Allows for methods to be passed as variables, useful for creating, for example, events * Allows for methods to be passed as variables, useful for creating, for example, events
@ -25,7 +26,7 @@ Events
Declare a delegate using the following syntax: Declare a delegate using the following syntax:
delegate \<return type> \<delegate name>(\<parameters>); delegate <return type> <delegate name>(<parameters>);
Example: Example:

Loading…
Cancel
Save