1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Text;
7 using System.Windows.Forms;
8
9 namespace TEST
10 {
11 public delegate void MyEventHandler();
12
13 public partial class Form1 : Form
14 {
15 public event MyEventHandler myEvent;
16
17 public Form1()
18 {
19 InitializeComponent();
20 }
21
22 private void button1_Click(object sender, EventArgs e)
23 {
24 myEvent += GetMY;
25
26 foreach (Delegate d in myEvent.GetInvocationList())
27 {
28 string ds = d.Method.Name;
29 }
30 }
31
32 public void GetMY()
33 {
34 }
35 }
36 }
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Text;
7 using System.Windows.Forms;
8
9 namespace TEST
10 {
11 public delegate void MyEventHandler();
12
13 public partial class Form1 : Form
14 {
15 public event MyEventHandler myEvent;
16
17 public Form1()
18 {
19 InitializeComponent();
20 }
21
22 private void button1_Click(object sender, EventArgs e)
23 {
24 myEvent += GetMY;
25
26 foreach (Delegate d in myEvent.GetInvocationList())
27 {
28 string ds = d.Method.Name;
29 }
30 }
31
32 public void GetMY()
33 {
34 }
35 }
36 }