Delegate, Multicast Delegate and Generic Delegate
Delegate | Multicast Delegate | Generic Delegate |
Multiple Examples and Live Results
Single Delegates Examples | Mapped Delegate Static and Instance Methods |
Multicast Delegate Examples | What are Generic Delegates, Types and Examples |
What is “Delegate”? What are different “Types” of Delegate? What is “Multicast Delegate”?What is “Generic Delegate”?
A Delegate is an object which holds the references to a method within delegate object.
A Delegate is a type-safe object.
A Delegate is invoking to methods in asynchronously manner.
A Delegate encapsulates a static method or instance methods.
A Delegate can be with parameters or without parameters.
Delegate’s benefits,
1) Improve the performance of application.
2) Encapsulate to methods call from caller.
3) Call a method asynchronously.
Three steps for using Delegates,
1) Declare
2) Create
3) Point
Syntax: - public delegate delegate_type delegate_name();
Types of Delegates,
1) Delegate
A delegate is use when you need to pass to single reference to a method within delegate object. Multicast Delegate is use when we needed to pass the more than one reference to a method within delegate object.
I hope you are enjoying with this post! Please share with you friends. Thank you!!!
You Might Also Like