DesignSurface.View 属性

定义

获取根设计器的视图。Gets the view for the root designer.

public:
 property System::Object ^ View { System::Object ^ get(); };
public object View { get; }
member this.View : obj
Public ReadOnly Property View As Object

属性值

Object

根设计器的视图。The view for the root designer.

例外

设计图面当前未加载,设计器加载程序尚未创建根设计器,或者设计图面虽已完成加载,但加载失败。The design surface is not loading, the designer loader has not yet created a root designer, or the design surface finished the load, but failed. InnerException 中可能提供了更多信息。More information may available in the InnerException.

设计器已加载,但是它没有提供与此设计图面兼容的视图。The designer loaded, but it does not offer a view compatible with this design surface.

附加到 DesignSurfaceIDesignerHost 已被释放。The IDesignerHost attached to the DesignSurface has been disposed.

示例

下面的代码示例演示如何 View 隐藏视图技术。The following code example shows how View hides view technologies.

IRootDesigner d;  

ViewTechnology[] supported = d.SupportedTechnologies;  

return d.GetView(supported[0]);

注解

BeginLoad必须事先调用方法以启动加载过程。The BeginLoad method must be called beforehand to start the loading process. 可以在设计器加载程序完成加载之前返回视图,因为提供视图的根设计器是设计器加载程序创建的第一个对象。It is possible to return a view before the designer loader finishes loading because the root designer, which supplies the view, is the first object created by the designer loader. 如果视图不可用,将 BeginLoad 引发异常。If a view is unavailable, BeginLoad raises an exception.

视图技术的概念已过时。The notion of a view technology is obsolete. 但它仍保留在根设计器的接口中,以实现向后兼容性。But, it remains in the interfaces for root designers for backward compatibility. 使用对象的任何人都不会看到其使用情况 DesignSurfaceIts use is hidden from anyone using DesignSurface objects. View属性通过将支持的技术传递回根设计器来隐藏视图技术。The View property hides view technologies by passing the supported technologies back into the root designer.

适用于