Alex Rivera | Logout

What does the event keyword really do?

Asked 2011-06-06T23:44:57.957
14
public delegate void SecondChangedHandler(
        object clock, 
        TimeInfoEventArgs timeInformation);

    public event SecondChangedHandler SecondChanged;

I have written a clock based on this article. Now if i remove the event keyword i get the same result, so what does event really do?

Edit
Report

1 Answer

2

The event keywords means only methods on the instance that hosts the SecondChanged field can invoke it. External attempts will fail.

answered 2011-06-06T23:49:53.387

Your Answer