When and why we should to use class System.ComponentModel.Container?

会有一股神秘感。 提交于 2019-12-03 11:52:28

In general, System.ComponentModel namespace exists for supporting component development - components can be visual (controls) and non-visuals. IMO, one should develop Components (in this context IComponent implementations) when design time support is needed. For example, you can drag Components on to the design surface in Visual Studio and access their properties. In this context, IContainer & Container represent a holder that will contain one or more components. I seriously doubt if you need to use System.ComponentModel.Container directly - this class would be used by .NET framework and Visual Studio (or other designer tools) internally. As far as, the code that you have sighted, it appears to be quite outdated and for that matter, it is not even instantiating Component class (just a reference is created).

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