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

保護的 (Protected) 屬性。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)

將背景影像、儲存格間距、儲存格填補、格線,以及對齊的相關資訊加入至要呈現的屬性 (Attribute) 清單中。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)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。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 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。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()
已過時。

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。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()

保護的 (Protected) 方法。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()

保護的 (Protected) 方法。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)

適用於

另請參閱