WebPartManagerInternals 类

定义

分离到由 WebPartManager 控件使用并且可由扩展该控件的网页开发人员重写的单独的类方法中,但是网页开发人员很少需要使用这些方法。Isolates into a separate class methods that are used by the WebPartManager control and can be overridden by developers who extend the control, but are rarely needed by page developers.

public ref class WebPartManagerInternals sealed
public sealed class WebPartManagerInternals
type WebPartManagerInternals = class
Public NotInheritable Class WebPartManagerInternals
继承
WebPartManagerInternals

注解

WebPartManager类是 Web 部件控件集中最大的类。The WebPartManager class is the largest class in the Web Parts control set. 它也是最重要的 Web 部件类,因为它用于包含 Web 部件控件的每个网页上,并协调和管理页面上的所有 Web 部件控件。It is also among the most important Web Parts classes because it is used on every Web page that contains Web Parts controls, and it coordinates and manages all Web Parts controls on a page.

由于 WebPartManager 类频繁使用,并且因为它包含如此多的公开方法,因此,扩展控件的控件开发人员通常需要一些方法,这些方法 WebPartManager 包含在 WebPartManagerInternals 类中。Because the WebPartManager class is used so frequently, and because it contains so many exposed methods, some methods needed mostly by control developers who are extending the WebPartManager control are contained in the WebPartManagerInternals class. 这种将不太常用的方法隔离到类中可 WebPartManagerInternals 简化类的 API WebPartManager ,而隔离的方法不会出现在 WebPartManager IntelliSense 中的对象上。This isolation of less-used methods into the WebPartManagerInternals class simplifies the API of the WebPartManager class, and the isolated methods do not appear on the WebPartManager object in IntelliSense.

使用类的开发人员可能会遇到这样的 WebPartManagerInternals 情况:需要从 WebPartManager 控件继承并对其进行广泛的自定义。Developers who use the WebPartManagerInternals class are likely to have scenarios where they need to inherit from the WebPartManager control and customize it extensively. 例如,如果您正在使用自定义显示模式、自定义区域、自定义谓词、自定义控件和基 Web 部件用户界面的其他扩展 (UI) 构建 Web 门户应用程序或一组打包的 Web 部件控件, WebPart 则在许多情况下,你将需要覆盖和扩展某些成员,这在许多情况下都 (。 WebPartManagerFor example, if you are building a Web portal application or a packaged set of Web Parts controls with custom display modes, custom zones, custom verbs, custom WebPart controls, and other extensions of the base Web Parts user interface (UI), in many cases (not all) you will need to override and extend some of the WebPartManager members. 尽管 WebPartManagerInternals 类是密封的,因此您不能从它继承,因此您的自定义 WebPartManager 类可能需要调用多个 WebPartManagerInternals 方法才能管理页上 Web 部件控件。And although the WebPartManagerInternals class is sealed so you cannot inherit from it, your custom WebPartManager class will likely need to call a number of the WebPartManagerInternals methods in order to manage Web Parts controls on a page.

备注

WebPartManager 类一样, WebPartManagerInternals 类提供的服务器控件没有 UI,并且在页面上从不可见。Like the WebPartManager class, the WebPartManagerInternals class provides a server control that has no UI and is never visible on a page. 与不同 WebPartManagerWebPartManagerInternals 类决不会在页的标记中声明; 它完全是执行后台任务的辅助角色对象。Unlike WebPartManager, the WebPartManagerInternals class is never declared in the markup of a page; it is strictly a worker object that performs background tasks. 使用此方法的典型方法是通过类进行演示 WebPartManager ,该类通过受保护的属性来引用它 Internals ,并使用被引用的对象调用 WebPartManagerInternals 方法。The typical way of using it is demonstrated by the WebPartManager class, which references it by means of the protected Internals property, and uses the referenced object to call the WebPartManagerInternals methods.

WebPartManagerInternals类只包含方法; 没有属性或事件。The WebPartManagerInternals class contains only methods; there are no properties or events. 类中的所有方法都涉及管理 WebPart 控件或控件之间的连接。All the methods in the class involve managing WebPart controls, or connections between controls.

若要处理 WebPart 控件, WebPartManagerInternals 包括添加它们的方法 (AddWebPart) ,删除它们 RemoveWebPart) ,处理事件 CallOnDeleting) ,获取或设置与区域的关系的详细信息 (例如, GetZoneIDSetZoneIndex) ,或设置基本 WebPart 控件属性 (例如 SetIsClosedSetHasSharedData) 。To handle WebPart controls, WebPartManagerInternals includes methods for adding them (AddWebPart), removing them RemoveWebPart), handling events CallOnDeleting), getting or setting details about their relationship to their zone (for example, GetZoneID and SetZoneIndex), or setting basic WebPart control properties (for example, SetIsClosed and SetHasSharedData).

若要处理连接, WebPartManagerInternals 包括 () 中删除它们的方法 DeleteConnection 、设置要使用的转换器对象 (SetTransformer) 、设置是否共享连接以及是否为静态 (SetIsShared(WebPartConnection, Boolean)SetIsStatic(WebPartConnection, Boolean)) ,以及如何将连接错误消息设置为使用 (SetConnectErrorMessage) 。To handle connections, WebPartManagerInternals includes methods for deleting them (DeleteConnection), setting which transformer object to use (SetTransformer), setting whether a connection is shared and whether it is static (SetIsShared(WebPartConnection, Boolean) and SetIsStatic(WebPartConnection, Boolean)), and setting a connection error message to use (SetConnectErrorMessage).

方法

AddWebPart(WebPart)

将一个 WebPart 或服务器控件添加到网页上的 WebPartManager 控件的 WebPart 控件集合中。Adds a WebPart or server control to the WebPartManager control's collection of WebPart controls on a Web page.

CallOnClosing(WebPart)

调用指定控件的 OnClosing(EventArgs) 方法。Calls the OnClosing(EventArgs) method of the specified control.

CallOnConnectModeChanged(WebPart)

调用指定控件的 OnConnectModeChanged(EventArgs) 方法。Calls the OnConnectModeChanged(EventArgs) method of the specified control.

CallOnDeleting(WebPart)

调用指定控件的 OnDeleting(EventArgs) 方法。Calls the OnDeleting(EventArgs) method of the specified control.

CallOnEditModeChanged(WebPart)

调用指定控件的 OnEditModeChanged(EventArgs) 方法。Calls the OnEditModeChanged(EventArgs) method of the specified control.

ConnectionDeleted(WebPartConnection)

指示指定的 WebPartConnection 对象是否已删除。Indicates whether the specified WebPartConnection object has been deleted.

CreateObjectFromType(Type)

根据传递给该方法的参数创建一个对象。Creates an object based on the parameter passed to the method.

DeleteConnection(WebPartConnection)

设置一个属性以指示指定的连接对象是否已删除。Sets a property to indicate that the specified connection object has been deleted.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetZoneID(WebPart)

获取包含指定 WebPart 或服务器控件的区域的 ID。Gets the ID of a zone that contains the specified WebPart or server control.

LoadConfigurationState(WebPartTransformer, Object)

加载参与两个控件之间的连接的 WebPartTransformer 对象的以前保存的状态数据。Loads previously saved state data for a WebPartTransformer object that participates in a connection between controls.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
RemoveWebPart(WebPart)

WebPart 控件的控件集合中移除 WebPartManager 或其他服务器控件。Removes a WebPart or other server control from the WebPartManager control's collection of controls.

SaveConfigurationState(WebPartTransformer)

保存参与两个控件之间的连接的 WebPartTransformer 对象的状态数据。Saves state data for a WebPartTransformer object that participates in a connection between controls.

SetConnectErrorMessage(WebPart, String)

建立错误信息,并且使得负责呈现 WebPartChrome 控件的 WebPart 对象呈现该消息而不是呈现控件的内容。Establishes an errors message, and causes the WebPartChrome object that is responsible for rendering a WebPart control to render that message rather than the contents of the control.

SetHasSharedData(WebPart, Boolean)

设置 WebPart 或其他服务器控件上的一个指示该控件是否具有共享个性化数据的属性。Sets a property on a WebPart or other server control indicating whether the control has shared personalization data.

SetHasUserData(WebPart, Boolean)

设置 WebPart 或其他服务器控件上的一个指示该控件是否具有用户个性化数据的属性。Sets a property on a WebPart or other server control indicating whether the control has user personalization data.

SetIsClosed(WebPart, Boolean)

设置 IsClosed 控件的 WebPart 属性。Sets the IsClosed property of a WebPart control.

SetIsShared(WebPart, Boolean)

设置 IsShared 控件的 WebPart 属性。Sets the IsShared property of a WebPart control.

SetIsShared(WebPartConnection, Boolean)

设置 IsShared 对象的 WebPartConnection 属性。Sets the IsShared property of a WebPartConnection object.

SetIsStandalone(WebPart, Boolean)

设置 IsStandalone 控件的 WebPart 属性。Sets the IsStandalone property of a WebPart control.

SetIsStatic(WebPart, Boolean)

设置 IsStatic 控件的 WebPart 属性。Sets the IsStatic property of a WebPart control.

SetIsStatic(WebPartConnection, Boolean)

设置 IsStatic 对象的 WebPartConnection 属性。Sets the IsStatic property of a WebPartConnection object.

SetTransformer(WebPartConnection, WebPartTransformer)

分配一个将在两个服务器控件之间的连接中使用的 WebPartTransformer 对象。Assigns a WebPartTransformer object to be used in a connection between two server controls.

SetZoneID(WebPart, String)

设置一个允许 WebPart 或服务器控件保留包含区域的 ID 的属性。Sets a property that enables a WebPart or server control to keep the ID of the containing zone.

SetZoneIndex(WebPart, Int32)

在特定控件所在区域中设置相对于该区域中其他 WebPart 控件的该特定控件的索引。Sets the index of the specified control within its zone relative to the other WebPart controls within the zone.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅