DesignerRegion 類別

定義

在設計階段標記內為關聯的控制項定義內容區域。

public ref class DesignerRegion : System::Web::UI::Design::DesignerObject
public class DesignerRegion : System.Web.UI.Design.DesignerObject
type DesignerRegion = class
    inherit DesignerObject
Public Class DesignerRegion
Inherits DesignerObject
繼承
DesignerRegion
衍生

備註

DesignerRegion物件代表實作所產生的ControlDesigner設計時間標記內的內容區域。 控件開發人員會使用自定義 ControlDesigner 實作中的設計工具區域,在相關聯控件的設計時間標記中定義不同的區域,並提供區域的編輯和事件處理。 Visual Studio 2005 等可視化設計工具可以使用設計工具區域,在設計介面上顯示控件的不同區域,並將區域的使用者事件提升至控件設計工具。 Designer 區域可以簡化控件設計工具實作,因為基底設計工具類別和可視化設計工具提供許多區域型功能。

類別 DesignerRegion 提供設計工具區域的基底功能,例如按兩下、選取及醒目提示設計介面中的區域。 DesignerRegion在控件設計工具實作中使用 物件來定義不需要編輯的區域。 在控件設計工具實作中使用衍生 EditableDesignerRegion 類別,在設計時間定義具有可編輯內容的區域。 在控件設計工具實作中使用衍生 TemplatedEditableDesignerRegion 類別,定義可編輯的區域,代表控件中的範本。

若要支援衍生自 ControlDesigner的類別內的區域,請覆寫 GetDesignTimeHtml 方法,並將一或多個初始化 DesignerRegion 的物件新增至 DesignerRegionCollection 集合。 您可以選擇性地透過覆寫 OnClick 方法,在設計介面上的區域中處理滑鼠點擊。

使用物件的屬性 DesignerRegion 來判斷可視化設計工具顯示區域的方式。 Selectable覆寫 屬性,指出使用者可以在設計介面上選取區域。 Highlight使用 屬性來反白顯示可視化設計工具中的設計工具區域;例如,按兩下即可在用戶按兩下以選取區域之後反白顯示區域。 DisplayName使用和 Description 屬性來儲存或擷取區域的其他詳細數據。 特別是,當使用者將滑鼠指標移至設計工具區域時, Description 可視化設計工具會使用 屬性來顯示工具提示資訊。 Designer使用屬性來存取包含設計工具區域之控件設計工具物件的方法和屬性。

建構函式

DesignerRegion(ControlDesigner, String)

使用控制項設計工具的指定名稱,初始化 DesignerRegion 類別的新執行個體。

DesignerRegion(ControlDesigner, String, Boolean)

使用控制項設計工具的指定名稱,初始化 DesignerRegion 類別的新執行個體,並選擇性地將執行個體設定為設計工具中的可選取區域。

欄位

DesignerRegionAttributeName

定義設計工具區域的 HTML 屬性名稱。

屬性

Description

取得或設定設計工具區域的描述。

Designer

取得關聯的設計工具元件。

(繼承來源 DesignerObject)
DisplayName

取得或設定設計工具區域的易記顯示名稱。

EnsureSize

取得或設定值,指出設計主應用程式是否將在設計工具區域上明確設定區域大小。

Highlight

取得或設定值,指出是否要反白顯示設計介面上的設計工具區域。

Name

取得物件的名稱。

(繼承來源 DesignerObject)
Properties

取得物件的屬性。

(繼承來源 DesignerObject)
Selectable

取得或設定值,指出使用者是否可以在設計介面上選取設計工具區域。

Selected

取得或設定值,指出目前是否已在設計介面上選取了設計工具區域。

UserData

取得或設定要與設計工具區域關聯的選擇性使用者資料。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetBounds()

擷取設計介面上設計工具區域的大小。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetService(Type)

從設計主應用程式取得服務,由所提供的型別識別。

(繼承來源 DesignerObject)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

IServiceProvider.GetService(Type)

如需這個成員的說明,請參閱 GetService(Type)

(繼承來源 DesignerObject)

擴充方法

GetKeyedService<T>(IServiceProvider, Object)

IServiceProvider取得 型T別的服務。

GetKeyedServices(IServiceProvider, Type, Object)

IServiceProvider取得 型serviceType別服務的列舉。

GetKeyedServices<T>(IServiceProvider, Object)

IServiceProvider取得 型T別服務的列舉。

GetRequiredKeyedService(IServiceProvider, Type, Object)

IServiceProvider取得 型serviceType別的服務。

GetRequiredKeyedService<T>(IServiceProvider, Object)

IServiceProvider取得 型T別的服務。

CreateAsyncScope(IServiceProvider)

建立可用來解析已設定範圍服務的新 AsyncServiceScope

CreateScope(IServiceProvider)

建立可用來解析已設定範圍服務的新 IServiceScope

GetRequiredService(IServiceProvider, Type)

IServiceProvider 取得 serviceType 類型的服務。

GetRequiredService<T>(IServiceProvider)

IServiceProvider 取得 T 類型的服務。

GetService<T>(IServiceProvider)

IServiceProvider 取得 T 類型的服務。

GetServices(IServiceProvider, Type)

IServiceProvider 取得類型 serviceType 服務的列舉。

GetServices<T>(IServiceProvider)

IServiceProvider 取得類型 T 服務的列舉。

GetFakeLogCollector(IServiceProvider)

取得 對象,這個物件會收集傳送至假記錄器的記錄檔記錄。

GetFakeRedactionCollector(IServiceProvider)

從相依性插入容器取得假的重構函式收集器實例。

適用於

另請參閱