Difference between event and delegate field

G

Guest

Hi everyone,

Given an delegate type as in

public delegate MyDelegate()

Does anyone know the difference between an event

public event MyDelegate MyEvent;

and a 'normal' delegate field

public MyDelegate MyEvent;

As far as I've understood, some client can subscribe to both of them using
the same syntax (MyEvent += new MyDelegate(...)) and all subscribers are
called using MyEvent().

So what's the difference (apart from a theoretical one) between the two
concepts?

Thank you for any clarification! :cool:

greetings
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top