Multicast Delegates in C sharp Arabic #38




Multicast Delegates in C sharp Arabic #38

Suggested Videos




Multicast Delegates

❑ A Multicast delegate is delegate that has references to more than one function. When you invoke a multicast delegate , all the function the delegate is pointing to, are invoked.

❑ There are 2 approaches to create a multicast delegate. Depending on the approach you use . + or+=to register a method with the delegate. - or-= to un-register a method with the delegate.

❑ Note: A multicast delegate . Invoke the methods in the invocation list, in the same order in which they are added.

❑ If the delegate has a return type other than void and if the delegate is multicast delegate , only the value of the last invoked method will be returned. Along the same lines , if the delegate has an out parameter , the value of the output parameter , will be the value assigned by the last method .

❑ Common interview question –Where do you use multicast delegates? Multicast delegate makes implementation of observer design pattern very simple. Observer pattern is also called as puplish /subscribe pattern.


Multicast Delegate Examples





Follow Us

YouTube

 If you want to download pptx : click Telegram

Facebook

Twitter

Instagram

Tik Tok

إرسال تعليق

أحدث أقدم