WebPartMenuStyle 类

定义

包含 WebPart 控件上菜单的样式特征。Contains style characteristics for menus on WebPart controls. 此类不能被继承。This class cannot be inherited.

public ref class WebPartMenuStyle sealed : System::Web::UI::WebControls::TableStyle, System::ComponentModel::ICustomTypeDescriptor
public sealed class WebPartMenuStyle : System.Web.UI.WebControls.TableStyle, System.ComponentModel.ICustomTypeDescriptor
type WebPartMenuStyle = class
    inherit TableStyle
    interface ICustomTypeDescriptor
Public NotInheritable Class WebPartMenuStyle
Inherits TableStyle
Implements ICustomTypeDescriptor
继承
实现

注解

WebPartMenuStyle类本质上是一个 TableStyle 对象,它包含要应用于控件上的菜单的样式特征 WebPartThe WebPartMenuStyle class is essentially a TableStyle object, which contains style characteristics to apply to menus on WebPart controls.

Web 部件控件集使用 WebPartMenuStyle 对象确定控件上谓词菜单的样式特征 WebPartThe Web Parts control set uses the WebPartMenuStyle object to determine the style characteristics of the verbs menu on a WebPart control. 谓词菜单包含在每个控件的标题栏中 WebPart ,并包含用户界面 (UI) 操作的各种用户界面, (称为谓词) ,用户可以执行这些操作,例如关闭、最小化、导出或删除控件。A verbs menu is contained in the title bar of each WebPart control, and it includes various user interface (UI) actions (called verbs) that users can perform, such as closing, minimizing, exporting, or deleting a control.

重要

通过使用区域上的属性,可以在该对象上设置样式属性,也可以 WebPartMenuStyle 在该区域中的所有控件的谓词菜单上设置样式特性 WebPart MenuPopupStyle WebPartZoneBaseYou can set style attributes on the WebPartMenuStyle object, and thus on the verbs menu of all the WebPart controls in a zone, by using the MenuPopupStyle property on a WebPartZoneBase zone.

WebPartMenuStyle类具有两个重要属性。The WebPartMenuStyle class has two important properties. 第一个是 HorizontalAlign 属性,该属性确定菜单的内容是在控件的左侧对齐、居中或右对齐还是未设置对齐方式。The first is the HorizontalAlign property, which determines whether the content of the menu is aligned on the left, the center, or the right of the control or the alignment is not set. ShadowColor WebPart 如果在用户的系统上启用了菜单阴影功能,则属性将确定控件上的菜单的阴影颜色。The ShadowColor property determines the color of the shadow for the menu on a WebPart control, if the menu shadowing feature is enabled on the user's system.

WebPartMenuStyle类还具有一些关键方法。The WebPartMenuStyle class also has some critical methods. CopyFrom方法从传入方法的样式对象复制非空白样式元素,并将它们应用于 WebPartMenuStyle 对象,并覆盖进程中的任何现有样式元素。The CopyFrom method copies nonblank style elements from the style object passed into the method, and applies them to the WebPartMenuStyle object, overwriting any existing style elements in the process. MergeWith 方法类似于从传递给方法的样式对象复制非空白样式元素,但它不会覆盖对象中的现有样式元素 WebPartMenuStyleThe MergeWith method similarly copies nonblank style elements from the style object passed to the method, but it does not overwrite existing style elements in the WebPartMenuStyle object. Reset方法从 WebPartMenuStyle 对象的状态袋中移除任何已定义的样式元素。The Reset method removes any defined style elements from the WebPartMenuStyle object's state bag.

WebPartMenuStyle类还实现了接口中包含的所有方法 ICustomTypeDescriptorThe WebPartMenuStyle class also implements all the methods contained in the ICustomTypeDescriptor interface. 通常,这使类可 WebPartMenuStyle 应用于不同类型的菜单。In general, this enables the WebPartMenuStyle class to be applied to different types of menus.

构造函数

WebPartMenuStyle()

用默认样式值初始化 WebPartMenuStyle 类的新实例。Initializes a new instance of the WebPartMenuStyle class using default style values.

WebPartMenuStyle(StateBag)

使用指定状态袋对象的样式值初始化 WebPartMenuStyle 类的新实例。Initializes a new instance of the WebPartMenuStyle class using style values from the specified state bag object.

属性

BackColor

获取或设置 Web 服务器控件的背景色。Gets or sets the background color of the Web server control.

(继承自 Style)
BackImageUrl

获取或设置要在表控件的背景中显示的图像的 URL。Gets or sets the URL of an image to display in the background of a table control.

(继承自 TableStyle)
BorderColor

获取或设置 Web 服务器控件的边框颜色。Gets or sets the border color of the Web server control.

(继承自 Style)
BorderStyle

获取或设置 Web 服务器控件的边框样式。Gets or sets the border style of the Web server control.

(继承自 Style)
BorderWidth

获取或设置 Web 服务器控件的边框宽度。Gets or sets the border width of the Web server control.

(继承自 Style)
CanRaiseEvents

获取一个指示组件是否可以引发事件的值。Gets a value indicating whether the component can raise an event.

(继承自 Component)
CellPadding

获取或设置单元格内容和单元格边框之间的空间量。Gets or sets the amount of space between the contents of the cell and the cell's border.

(继承自 TableStyle)
CellSpacing

获取或设置表单元格之间的距离。Gets or sets the distance between table cells.

(继承自 TableStyle)
Container

获取包含 IContainerComponentGets the IContainer that contains the Component.

(继承自 Component)
CssClass

获取或设置由 Web 服务器控件在客户端呈现的级联样式表 (CSS) 类。Gets or sets the cascading style sheet (CSS) class rendered by the Web server control on the client.

(继承自 Style)
DesignMode

获取一个值,用以指示 Component 当前是否处于设计模式。Gets a value that indicates whether the Component is currently in design mode.

(继承自 Component)
Events

获取附加到此 Component 的事件处理程序的列表。Gets the list of event handlers that are attached to this Component.

(继承自 Component)
Font

获取与 Web 服务器控件关联的字体属性。Gets the font properties associated with the Web server control.

(继承自 Style)
ForeColor

获取或设置 Web 服务器控件的前景色(通常是文本颜色)。Gets or sets the foreground color (typically the color of the text) of the Web server control.

(继承自 Style)
GridLines

获取或设置一个值,该值指定是否显示表控件的单元格之间的边框。Gets or sets a value that specifies whether the border between the cells of the table control is displayed.

(继承自 TableStyle)
Height

获取或设置 Web 服务器控件的高度。Gets or sets the height of the Web server control.

(继承自 Style)
HorizontalAlign

获取一个值,该值指示 WebPart 控件上的菜单内容要使用哪种水平对齐方式。Gets a value indicating what type of horizontal alignment to use for the content of a menu on a WebPart control.

IsEmpty

保护属性。A protected property. 获取一个值,该值指示是否已在状态袋中定义任何样式元素。Gets a value indicating whether any style elements have been defined in the state bag.

(继承自 Style)
IsTrackingViewState

返回一个值,该值指示状态袋中是否有任何已定义的样式元素。Returns a value indicating whether any style elements have been defined in the state bag.

(继承自 Style)
RegisteredCssClass

获取已向控件注册的级联样式表 (CSS) 类。Gets the cascading style sheet (CSS) class that is registered with the control.

(继承自 Style)
ShadowColor

获取或设置一个值,该值确定 WebPart 控件上菜单的阴影颜色。Gets or sets a value that determines the shadow color for a menu on a WebPart control.

Site

获取或设置 ComponentISiteGets or sets the ISite of the Component.

(继承自 Component)
ViewState

获取保存样式元素的状态袋。Gets the state bag that holds the style elements.

(继承自 Style)
Width

获取或设置 Web 服务器控件的宽度。Gets or sets the width of the Web server control.

(继承自 Style)

方法

AddAttributesToRender(HtmlTextWriter)

将需要呈现的 HTML 特性和样式添加到指定的 HtmlTextWriter 中。Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriter. 此方法主要由控件开发人员使用。This method is primarily used by control developers.

(继承自 Style)
AddAttributesToRender(HtmlTextWriter, WebControl)

将有关背景图像、单元格间距、单元格填充、网格线和对齐方式的信息添加到要呈现的特性列表中。Adds information about the background image, cell spacing, cell padding, gridlines, and alignment to the list of attributes to render.

(继承自 TableStyle)
CopyFrom(Style)

将非空样式元素复制到 WebPartMenuStyle 对象,覆盖进程中的所有现有样式元素。Copies nonblank style elements to the WebPartMenuStyle object, overwriting any existing style elements in the process.

CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(继承自 MarshalByRefObject)
Dispose()

释放由 Component 使用的所有资源。Releases all resources used by the Component.

(继承自 Component)
Dispose(Boolean)

释放由 Component 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the Component and optionally releases the managed resources.

(继承自 Component)
Equals(Object)

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

(继承自 Object)
FillStyleAttributes(CssStyleCollection, IUrlResolutionService)

TableStyle 对象的样式属性添加到指定的 CssStyleCollection 集合中。Adds the style properties of the TableStyle object to the specified CssStyleCollection collection.

(继承自 TableStyle)
GetHashCode()

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

(继承自 Object)
GetLifetimeService()
已过时。

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(继承自 MarshalByRefObject)
GetService(Type)

返回一个对象,该对象表示由 Component 或它的 Container 提供的服务。Returns an object that represents a service provided by the Component or by its Container.

(继承自 Component)
GetStyleAttributes(IUrlResolutionService)

检索实现了 CssStyleCollection 的指定对象的 IUrlResolutionService 对象。Retrieves the CssStyleCollection object for the specified IUrlResolutionService-implemented object.

(继承自 Style)
GetType()

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

(继承自 Object)
InitializeLifetimeService()
已过时。

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(继承自 MarshalByRefObject)
LoadViewState(Object)

加载以前保存的状态。Loads the previously saved state.

(继承自 Style)
MemberwiseClone()

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

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(继承自 MarshalByRefObject)
MergeWith(Style)

将非空样式元素复制到 WebPartMenuStyle 实例,但不覆盖现有样式元素。Copies nonblank style elements to the WebPartMenuStyle instance, but does not overwrite existing style elements.

Reset()

WebPartMenuStyle 对象的状态袋中移除所有已定义的样式元素。Removes any defined style elements from the WebPartMenuStyle object's state bag.

SaveViewState()

受保护的方法。A protected method. 保存在调用 TrackViewState() 方法后已修改的任何状态。Saves any state that has been modified after the TrackViewState() method was invoked.

(继承自 Style)
SetBit(Int32)

受保护的内部方法。A protected internal method. 设置一个内部位屏蔽字段以指示存储在状态袋中的样式属性。Sets an internal bitmask field that indicates the style properties that are stored in the state bag.

(继承自 Style)
SetDirty()

标记 Style 以便在视图状态中记录其状态。Marks the Style so that its state will be recorded in view state.

(继承自 Style)
ToString()

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

(继承自 Style)
TrackViewState()

受保护的方法。A protected method. 标记跟踪控件状态更改的起始点。Marks the beginning for tracking state changes on the control. 跟踪开始之后所做的任何更改都将被跟踪并保存到控件视图状态中。Any changes made after tracking has begun will be tracked and saved as part of the control view state.

(继承自 Style)

事件

Disposed

在通过调用 Dispose() 方法释放组件时发生。Occurs when the component is disposed by a call to the Dispose() method.

(继承自 Component)

显式接口实现

ICustomTypeDescriptor.GetAttributes()

返回此组件实例的自定义属性的集合。Returns a collection of custom attributes for this instance of a component. 实现 GetAttributes() 方法。Implements the GetAttributes() method.

ICustomTypeDescriptor.GetClassName()

返回此组件实例的类名称。Returns the class name of this instance of a component. 此方法实现 GetClassName() 方法。This method implements the GetClassName() method.

ICustomTypeDescriptor.GetComponentName()

返回某个组件的此实例的名称。Returns the name of this instance of a component. 此方法实现 GetComponentName() 方法。This method implements the GetComponentName() method.

ICustomTypeDescriptor.GetConverter()

返回此组件实例的类型转换器。Returns a type converter for this instance of a component. 此方法实现 GetConverter() 方法。This method implements the GetConverter() method.

ICustomTypeDescriptor.GetDefaultEvent()

返回某个组件的此实例的默认事件。Returns the default event for this instance of a component. 此方法实现 GetDefaultEvent() 方法。This method implements the GetDefaultEvent() method.

ICustomTypeDescriptor.GetDefaultProperty()

返回此组件实例的默认属性。Returns the default property for this instance of a component. 此方法实现 GetDefaultProperty() 方法。This method implements the GetDefaultProperty() method.

ICustomTypeDescriptor.GetEditor(Type)

返回此组件实例的指定类型的编辑器。Returns an editor of the specified type for this instance of a component. 此方法实现 GetEditor(Type) 方法。This method implements the GetEditor(Type) method.

ICustomTypeDescriptor.GetEvents()

返回此组件实例的事件。Returns the events for this instance of a component. 此方法实现 GetEvents() 重载方法。This method implements the GetEvents() method overload.

ICustomTypeDescriptor.GetEvents(Attribute[])

使用指定的属性数组作为筛选器,返回此组件实例的事件。Returns the events for this instance of a component using the specified attribute array as a filter. 此方法实现 GetEvents(Attribute[]) 重载方法。This method implements the GetEvents(Attribute[]) method overload.

ICustomTypeDescriptor.GetProperties()

返回此组件实例的属性。Returns the properties for this instance of a component. 此方法实现 GetProperties() 重载方法。This method implements the GetProperties() method overload.

ICustomTypeDescriptor.GetProperties(Attribute[])

使用特性数组作为筛选器,返回此组件实例的属性。Returns the properties for this instance of a component using the attribute array as a filter. 此方法实现 GetProperties(Attribute[]) 重载方法。This method implements the GetProperties(Attribute[]) method overload.

ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor)

返回一个对象,该对象包含指定的属性描述符所描述的属性。Returns an object that contains the property described by the specified property descriptor. 此方法实现 GetPropertyOwner(PropertyDescriptor) 方法。This method implements the GetPropertyOwner(PropertyDescriptor) method.

IStateManager.IsTrackingViewState

获取一个值,该值指示服务器控件是否在跟踪其视图状态更改。Gets a value that indicates whether a server control is tracking its view state changes.

(继承自 Style)
IStateManager.LoadViewState(Object)

加载以前保存的状态。Loads the previously saved state.

(继承自 Style)
IStateManager.SaveViewState()

返回包含状态更改的对象。Returns the object containing state changes.

(继承自 Style)
IStateManager.TrackViewState()

开始跟踪状态更改。Starts tracking state changes.

(继承自 Style)

适用于

另请参阅