Observers property in TComponent

我只是一个虾纸丫 提交于 2019-12-09 04:41:15

问题


Hi Delphi XE2 TComponent has a new "Observers" property. Unfortunately the help entries for this are empty. Does anybody know what this new property is good for and how to use it? Edit: Well i know that it is related to LiveBindings, but I would love to know a bit more about it, and since I have no access to XE2 source code, I can't investigate myself.


回答1:


It is related to LiveBindings. A rather cool but extensive subject, explained in the new DocWiki for XE2.




回答2:


The Delphi implementation of the observer pattern is explained here:

http://blogs.teamb.com/joannacarter/2004/06/30/690

I'll update the answer with more details as soon as I've had a chance to look at the source code.




回答3:


The Delphi XE7 documentation now goes much deeper into the details of the Observers:

Observers is a read-only property that returns the TObservers added to the TComponent, in order to use the notifications provided by the observers either with LiveBindings or for the developers' own purposes.

Note that the Observer in Fringe can be seen on the scene of many Pattern-related events.


Side note:

Observers might also be able to detect situations where a EProgrammerNotFound exception must be thrown by the RTL.



来源:https://stackoverflow.com/questions/7287444/observers-property-in-tcomponent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!