You can only do it from within the class that creates the event:
public class MyClass
{
public event EventHandler MyEvent;
protected virtual void OnMyEvent(EventArgs e)
{
EventHandler eh = MyEvent;
if (eh != null)
{
eh(this, e);
}
}
public int CountEvents()
{
return MyEvent.GetInvocationList().Length;
}
}
...
private void MyButton_Click(object sender, EventArgs e)
{
MyClass mc = new MyClass();
mc.MyEvent += mc_MyEvent;
Console.WriteLine(mc.CountEvents());
mc.MyEvent += mc_MyEvent;
Console.WriteLine(mc.CountEvents());