---
title: "Use of Multicast Delegate in C#?"  
description: "Use of Multicast Delegate in C#?"  
author: "Anupam Mishra"  
published: 2016-01-27  
updated: 2016-01-28  
canonical: https://www.mindstick.com/forum/33936/use-of-multicast-delegate-in-c-sharp  
category: "c#"  
tags: ["c#", ".net"]  
reading_time: 1 minute  

---

# Use of Multicast Delegate in C#?

Hi EveryoneI am using delegates in program. But situation is to more than one [method](https://www.mindstick.com/forum/166/webservice-method) to adding to a delegate. Please [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) can give me a solution with example how to done this?\
Thakyou

## Replies

### Reply by Anupam Mishra

Multicast delegate is an extension of normal delegate. It helps you to point more than one method at a single moment of time.

In a windows application, we created a button on a form and on the button click, we want to invoke two methods (AlertMsg(), WarningMsg()). So the code is as follow:

\

```
public class Deligatedemo{    public Deligatedemo ()    {    }    // Declare a delegate public delegate void Notification(string msg);    public void Process(Notification handler)    {        if (handler != null)            handler("Alert  Message");        if (handler != null)            handler("Warning   Message");    }}  public class demoClass{    //This method will show alert message to user    public static void AlertMsg (string s)    {         MessageBox.Show(s);    }    //This method will show warning message to user    public static void WarningMsg(string s)    {         MessageBox.Show(s);     } } private void button1_Click(object sender, System.EventArgs e){     Deligatedemo dc = new Deligatedemo();    Deligatedemo. Notification notified = null;    notified+= new DeligateClass. Notification (AlertMsg);    notified+= new      DeligateClass. Notification (WarningMsg);    dc.Process(notified); }
```


---

Original Source: https://www.mindstick.com/forum/33936/use-of-multicast-delegate-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
