Design Pattern Summary - Observer pattern

Many dependencies defined, so that multiple objects at the same time observer objects listening to a topic, theme object when status changes, will notify all observers objects.

1.delegate void EventHandler () declares a special "class."

2.public event EventHandler Update () to declare an event delegate variable.

3.Update + = new EventHandler (Method) create a delegate instance, equal to delegate to the method Update.

 

Published 12 original articles · won praise 2 · Views 5997

Guess you like

Origin blog.csdn.net/qq_19533777/article/details/104251045