积极答复者
C# 控件的site属性的作用

问题
-
如题,site属性有什么作用,MSDN里面只是说了设置控件的站点,什么是站点,具体怎麽用?
- 已更改类型 Martin_XieModerator 2011年10月5日 8:43 Change to question so that more beginners can search out it.
答案
-
Site 是 Component 需要的东西,一般都是与控件设计器有关的,具体我倒是没有发现有什么用处。
Mark Zhou- 已标记为答案 Martin_XieModerator 2011年10月5日 8:43
-
这个我们一般用不到。主要是给 Visual Studio 提供设计时支持的。
Visual Studio 可以通过这个接口获得当前设计器的信息。
Component.Site 属性 获取或设置 Component 的 ISite。
ISite接口提供站点所需的功能。
http://msdn.microsoft.com/zh-cn/library/system.componentmodel.isite.aspx
Site将 Component绑定到 Container 并启用它们之间的通讯,同时为该容器提供了一种管理其组件的方法。站点也可以用作容器特定信息、基于组件信息(如组件名)的储存库。
Martin Xie [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Martin_XieModerator 2011年10月5日 8:43
全部回复
-
Site 是 Component 需要的东西,一般都是与控件设计器有关的,具体我倒是没有发现有什么用处。
Mark Zhou- 已标记为答案 Martin_XieModerator 2011年10月5日 8:43
-
这个我们一般用不到。主要是给 Visual Studio 提供设计时支持的。
Visual Studio 可以通过这个接口获得当前设计器的信息。
Component.Site 属性 获取或设置 Component 的 ISite。
ISite接口提供站点所需的功能。
http://msdn.microsoft.com/zh-cn/library/system.componentmodel.isite.aspx
Site将 Component绑定到 Container 并启用它们之间的通讯,同时为该容器提供了一种管理其组件的方法。站点也可以用作容器特定信息、基于组件信息(如组件名)的储存库。
Martin Xie [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Martin_XieModerator 2011年10月5日 8:43