語言

AccessDataSourceDesigner 類別

定義

提供網頁伺服器控制的視覺化設計器 AccessDataSource 設計時支援。

public ref class AccessDataSourceDesigner : System::Web::UI::Design::WebControls::SqlDataSourceDesigner
public class AccessDataSourceDesigner : System.Web.UI.Design.WebControls.SqlDataSourceDesigner
type AccessDataSourceDesigner = class
    inherit SqlDataSourceDesigner
Public Class AccessDataSourceDesigner
Inherits SqlDataSourceDesigner
繼承

範例

本節提供兩個程式碼範例。 第一個示範如何擴展 AccessDataSourceDesigner 課程。 第二項示範如何衍生該類別的副本 AccessDataSource 並將其與設計師關聯。

以下程式碼範例示範如何擴充該 AccessDataSourceDesigner 類別。 程式碼會修改代表設計表面控制項的佔位符,並在 屬性 網格中新增屬性。

// Shadow control properties with design time properties.
protected override void PreFilterProperties(IDictionary properties)
{
    // Call the base class method first.
    base.PreFilterProperties(properties);

    // Add the ConnectionString property to the property grid.
    PropertyDescriptor property =
        (PropertyDescriptor)properties["ConnectionString"];
    Attribute[] attributes = new Attribute[]
    {
        new BrowsableAttribute(true),
        new ReadOnlyAttribute(true)
    };
    properties["ConnectionString"] = TypeDescriptor.CreateProperty(
        GetType(), property, attributes);
}
' Shadow control properties with design time properties.
Protected Overrides Sub PreFilterProperties(ByVal properties As IDictionary)

    ' Call the base class method first.
    MyBase.PreFilterProperties(properties)

    ' Add the ConnectionString property to the property grid.
    Dim prop As PropertyDescriptor
    prop = CType(properties("ConnectionString"), PropertyDescriptor)

   Dim atts(1) As Attribute
    atts(0) = New BrowsableAttribute(True)
    atts(1) = New ReadOnlyAttribute(True)

    properties("ConnectionString") = TypeDescriptor.CreateProperty( _
        prop.GetType(), prop, atts)
End Sub

以下程式碼範例示範如何衍生該 AccessDataSource 類別的副本,並將其與前述範例中定義的設計器關聯。

// Create a control and bind it to the ExampleAccessDataSourceDesigner.
[AspNetHostingPermission(System.Security.Permissions.SecurityAction.Demand,
    Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
[Designer(typeof(CustomControls.Design.ExampleAccessDataSourceDesigner))]
public class ExampleAccessDataSource : AccessDataSource
{
    // Does nothing extra
}
' Create a control and bind it to the ExampleAccessDataSourceDesigner.
<AspNetHostingPermission(System.Security.Permissions.SecurityAction.Demand, _
    Level:=System.Web.AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, _
    Level:=System.Web.AspNetHostingPermissionLevel.Minimal)> _
<Designer("CustomControls.Design.ExampleAccessDataSourceDesigner")> _
Public Class ExampleAccessDataSource
    Inherits AccessDataSource

    ' Does nothing extra
End Class

備註

在視覺設計器中,當你從原始碼視圖切換到設計視圖時,描述控制項的標記原始碼 AccessDataSource 會被解析,並在設計表面建立一個設計時版本,僅作為佔位符。 當你切回原始碼視圖時,設計時控制項(包含 屬性 格子中屬性的值)會持續存在於標記原始碼,並編輯到網頁的標記中。

建構函式

名稱 Description
AccessDataSourceDesigner()

初始化 AccessDataSource 類別的新執行個體。

屬性

名稱 Description
ActionLists

在設計時會取得一份用於建立行動清單選單的項目清單。

(繼承來源 DataSourceDesigner)
AllowResize

會獲得一個值,表示控制項是否能在設計時環境中調整大小。

(繼承來源 ControlDesigner)
AssociatedComponents

取得設計師管理的與該元件相關的元件集合。

(繼承來源 ComponentDesigner)
AutoFormats

取得預設自動格式化方案集合,於設計時顯示於相關控制項的 自動格式 化對話框中。

(繼承來源 ControlDesigner)
Behavior
已淘汰.

取得或設定與設計器相關的 DHTML 行為。

(繼承來源 HtmlControlDesigner)
CanConfigure

會取得一個值,表示設計主機是否能呼叫該 Configure() 方法。

(繼承來源 SqlDataSourceDesigner)
CanRefreshSchema

會取得一個值,表示設計主機是否能呼叫該 RefreshSchema(Boolean) 方法。

(繼承來源 SqlDataSourceDesigner)
Component

取得設計師正在設計的元件。

(繼承來源 ComponentDesigner)
ConnectionString

取得或設定用來開啟資料庫的字串。

(繼承來源 SqlDataSourceDesigner)
DataBindings

取得目前控制項的資料綁定收集。

(繼承來源 HtmlControlDesigner)
DataBindingsEnabled

取得一個值,表示相關控制項的包含區域是否支援資料綁定。

(繼承來源 ControlDesigner)
DataFile

實作設計屬性以遮蔽 DataFile 相關控制項的屬性。

DeleteQuery

取得或設定 SqlDataSourceDesigner 支援刪除查詢的 。

(繼承來源 SqlDataSourceDesigner)
DesignerState

取得一個物件,用於在設計時持久化相關控制項的資料。

(繼承來源 ControlDesigner)
DesignTimeElement
已淘汰.

取得代表該物件在設計表面上所關聯 HtmlControlDesigner 控制項的設計時物件。

(繼承來源 HtmlControlDesigner)
DesignTimeElementView
已淘汰.

取得控制設計器的視控物件。

(繼承來源 ControlDesigner)
DesignTimeHtmlRequiresLoadComplete
已淘汰.

會取得一個值,表示設計主機是否必須完成載入才能呼叫該 GetDesignTimeHtml 方法。

(繼承來源 ControlDesigner)
Expressions

在設計時取得目前控制項的表達式綁定。

(繼承來源 HtmlControlDesigner)
HidePropertiesInTemplateMode

會取得一個值,表示當控制項處於模板模式時,相關控制項的屬性是否被隱藏。

(繼承來源 ControlDesigner)
ID

取得或設定控制項的 ID 字串。

(繼承來源 ControlDesigner)
InheritanceAttribute

會獲得一個屬性,表示相關元件繼承的類型。

(繼承來源 ComponentDesigner)
Inherited

會得到一個值,表示該元件是否為繼承。

(繼承來源 ComponentDesigner)
InsertQuery

取得或設定 SqlDataSourceDesigner 支援插入查詢的 。

(繼承來源 SqlDataSourceDesigner)
InTemplateMode

會獲得一個值,表示控制項在設計主機中是處於範本檢視模式還是編輯模式。 該 InTemplateMode 屬性為唯讀。

(繼承來源 ControlDesigner)
IsDirty
已淘汰.

取得或設定一個值,表示網頁伺服器控制項是否被標記為變更。

(繼承來源 ControlDesigner)
ParentComponent

取得這個設計器的父元件。

(繼承來源 ComponentDesigner)
ProviderName

取得或設定 .NET Framework 資料提供者的名稱,該控制器用來 SqlDataSource 連接底層資料來源。

(繼承來源 SqlDataSourceDesigner)
ReadOnly
已淘汰.

取得或設定一個值,表示控制項屬性在設計時是否為唯讀。

(繼承來源 ControlDesigner)
RootDesigner

取得包含相關控制項的網頁表單頁面的控制項設計器。

(繼承來源 ControlDesigner)
SelectCommand

在相關 SqlDataSource 資料庫中取得或設定 SQL 查詢,以選擇底層資料庫的資料。

(繼承來源 SqlDataSourceDesigner)
SelectQuery

取得或設定 SqlDataSourceDesigner 支援選擇查詢的 。

(繼承來源 SqlDataSourceDesigner)
ShadowProperties

會取得一組屬性值,覆蓋使用者設定。

(繼承來源 ComponentDesigner)
ShouldCodeSerialize
已淘汰.

在序列化過程中,會取得或設定一個值,指示是否要在目前設計文件的程式碼背後檔案中為控制項建立欄位宣告。

(繼承來源 HtmlControlDesigner)
SuppressingDataSourceEvents

會獲得一個值,表示事件或DataSourceChanged方法是否RefreshSchema(Boolean)發生。

(繼承來源 DataSourceDesigner)
Tag

取得一個代表相關控制項 HTML 標記元素的物件。

(繼承來源 ControlDesigner)
TemplateGroups

獲得一組模板群組,每個群組包含一個或多個範本定義。

(繼承來源 ControlDesigner)
UpdateQuery

取得或設定支援更新查詢的 。SqlDataSourceDesigner

(繼承來源 SqlDataSourceDesigner)
UsePreviewControl

會取得一個值,指示控制項設計者是否使用暫存預覽控制來產生設計時的 HTML 標記。

(繼承來源 ControlDesigner)
Verbs

取得與設計者相關元件所支援的設計時動詞。

(繼承來源 ComponentDesigner)
ViewControl

取得或設定一個網頁伺服器控制項,可用於預覽設計時的 HTML 標記。

(繼承來源 ControlDesigner)
ViewControlCreated

取得或設定一個值,指示是否 View 已建立控制項以顯示於設計表面。

(繼承來源 ControlDesigner)
Visible

會獲得一個值,表示該控制點在設計時是否可見。

(繼承來源 ControlDesigner)

方法

名稱 Description
Configure()

在設計主機中啟動資料來源配置工具。

(繼承來源 SqlDataSourceDesigner)
CreateErrorDesignTimeHtml(String, Exception)

建立 HTML 標記,在設計時顯示指定的例外錯誤訊息。

(繼承來源 ControlDesigner)
CreateErrorDesignTimeHtml(String)

建立 HTML 標記,在設計時顯示指定的錯誤訊息。

(繼承來源 ControlDesigner)
CreatePlaceHolderDesignTimeHtml()

提供簡單的矩形佔位符號表示,顯示控制項的類型與 ID。

(繼承來源 ControlDesigner)
CreatePlaceHolderDesignTimeHtml(String)

提供簡單的矩形佔位符號表示,顯示控制項的類型與 ID,以及額外指定的指令或資訊。

(繼承來源 ControlDesigner)
CreateView(String)

用指定的名稱建立一個新 SqlDesignerDataSourceView 實例。

(繼承來源 SqlDataSourceDesigner)
CreateViewControl()

回傳相關控制項的副本,用於在設計表面上檢視或渲染。

(繼承來源 ControlDesigner)
DeriveParameters(String, DbCommand)

從指定的 SQL 指令衍生參數,並將相應 Parameter 物件加入指令的參數集合中。

(繼承來源 SqlDataSourceDesigner)
Dispose()

釋放 ComponentDesigner所使用的所有資源。

(繼承來源 ComponentDesigner)
Dispose(Boolean)

釋放物件使用的 HtmlControlDesigner 非管理資源,並可選擇性地釋放受管理資源。

(繼承來源 HtmlControlDesigner)
DoDefaultAction()

在原始碼檔案中為元件的預設事件建立方法簽章,並引導使用者游標到該位置。

(繼承來源 ComponentDesigner)
Equals(Object)

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

(繼承來源 Object)
GetBounds()

取得代表控制點邊界的矩形座標,該矩形在設計表面上顯示。

(繼承來源 ControlDesigner)
GetConnectionString()

取得設計時對該設計器相關控制項有效的連接字串。

GetDesignTimeHtml()

在設計時擷取 HTML 標記,以顯示相關的資料來源控制。

(繼承來源 DataSourceDesigner)
GetDesignTimeHtml(DesignerRegionCollection)

取得 HTML 標記以顯示控制項,並將目前控制項設計區域填充集合。

(繼承來源 ControlDesigner)
GetEditableDesignerRegionContent(EditableDesignerRegion)

回傳可編輯區域中可編輯的相關控制項。

(繼承來源 ControlDesigner)
GetEmptyDesignTimeHtml()

取得 HTML 標記,以表示設計時的網頁伺服器控制項,執行時不會有視覺化表示。

(繼承來源 ControlDesigner)
GetErrorDesignTimeHtml(Exception)

取得提供指定例外資訊的 HTML 標記。

(繼承來源 ControlDesigner)
GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetPersistenceContent()

在設計時擷取控制項的持久性內部 HTML 標記。

(繼承來源 ControlDesigner)
GetPersistInnerHtml()
已淘汰.

取得控制項的持久性內部 HTML 標記。

(繼承來源 ControlDesigner)
GetService(Type)

嘗試從設計者元件的設計模式網站擷取指定類型的服務。

(繼承來源 ComponentDesigner)
GetType()

取得目前實例的 Type。

(繼承來源 Object)
GetView(String)

擷取 DesignerDataSourceView 以視圖名稱識別的物件。

(繼承來源 SqlDataSourceDesigner)
GetViewNames()

會獲得可用視圖清單。

(繼承來源 SqlDataSourceDesigner)
GetViewRendering()

擷取包含相關控制項內容及區域設計時標記的物件。

(繼承來源 ControlDesigner)
InferParameterNames(DesignerDataConnection, String, SqlDataSourceCommandType)

回傳一組參數陣列,使用指定的連線、指令文字及命令類型。

(繼承來源 SqlDataSourceDesigner)
Initialize(IComponent)

初始化控制設計器並載入指定的元件。

(繼承來源 ControlDesigner)
InitializeExistingComponent(IDictionary)

重新初始化現有元件。

(繼承來源 ComponentDesigner)
InitializeNewComponent(IDictionary)

初始化新建立的元件。

(繼承來源 ComponentDesigner)
InitializeNonDefault()
已淘汰.
已淘汰.

初始化已初始化為非預設設定的匯入元件的設定。

(繼承來源 ComponentDesigner)
Invalidate()

會使設計表面上顯示的整個控制區域失效,並指示控制設計師重新繪製控制控制。

(繼承來源 ControlDesigner)
Invalidate(Rectangle)

使顯示在設計表面上的控制區域失效,並指示控制設計師重新繪製控制控制。

(繼承來源 ControlDesigner)
InvokeGetInheritanceAttribute(ComponentDesigner)

得到 InheritanceAttribute 指定的 ComponentDesigner。

(繼承來源 ComponentDesigner)
IsPropertyBound(String)
已淘汰.

擷取一個值,指示相關控制項上的指定屬性是否為資料綁定。

(繼承來源 ControlDesigner)
Localize(IDesignTimeResourceWriter)

利用提供的資源寫入器,將相關控制項的可區域化屬性持久化至設計主機中的資源。

(繼承來源 ControlDesigner)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
OnAutoFormatApplied(DesignerAutoFormat)

當已對相關控制項套用預先定義的自動格式化方案時,會呼叫此系統。

(繼承來源 ControlDesigner)
OnBehaviorDetaching()
已淘汰.

當行為與元素分離時被召喚。

(繼承來源 HtmlControlDesigner)
OnBindingsCollectionChanged(String)
已淘汰.

當資料綁定集合變更時會被呼叫。

(繼承來源 ControlDesigner)
OnClick(DesignerRegionMouseEventArgs)

當使用者在設計時點擊相關控制項時,設計主機會呼叫此功能。

(繼承來源 ControlDesigner)
OnComponentChanged(Object, ComponentChangedEventArgs)

當相關控制變更時會被呼叫。

(繼承來源 ControlDesigner)
OnComponentChanging(Object, ComponentChangingEventArgs)

代表將 ComponentChanging 處理相關控制項事件的方法。

(繼承來源 ControlDesigner)
OnControlResize()
已淘汰.

當設計主機在設計時調整了相關的網頁伺服器控制項時,會呼叫。

(繼承來源 ControlDesigner)
OnDataSourceChanged(EventArgs)

當資料來源屬性改變且DataSourceChanged值為 SuppressingDataSourceEvents時,該事件會false觸發。

(繼承來源 DataSourceDesigner)
OnPaint(PaintEventArgs)

當控制設計者在設計表面繪製相關控制項時,若值 CustomPaint 為 true,則呼叫 。

(繼承來源 ControlDesigner)
OnSchemaRefreshed(EventArgs)

當資料來源的結構改變且SchemaRefreshed值為 SuppressingDataSourceEvents時,會觸發false事件。

(繼承來源 DataSourceDesigner)
OnSetComponentDefaults()
已淘汰.
已淘汰.

設定元件的預設屬性。

(繼承來源 ComponentDesigner)
OnSetParent()

提供一種當相關控制連接父控制時,執行額外處理的方式。

(繼承來源 HtmlControlDesigner)
PostFilterAttributes(IDictionary)

允許設計者更改或移除其透過 TypeDescriptor.

(繼承來源 ComponentDesigner)
PostFilterEvents(IDictionary)

允許設計者更改或移除透過 TypeDescriptor.

(繼承來源 ComponentDesigner)
PostFilterProperties(IDictionary)

允許設計者更改或移除透過 TypeDescriptor.

(繼承來源 ComponentDesigner)
PreFilterAttributes(IDictionary)

允許設計者透過 . 來擴充其所暴露 TypeDescriptor的屬性集合。

(繼承來源 ComponentDesigner)
PreFilterEvents(IDictionary)

設定元件物件在設計時 TypeDescriptor 會被暴露的事件清單。

(繼承來源 HtmlControlDesigner)
PreFilterProperties(IDictionary)

設計者用來新增或移除屬性格子中的屬性,或遮蔽相關控制項的屬性。

RaiseComponentChanged(MemberDescriptor, Object, Object)

通知該 IComponentChangeService 元件已被更改。

(繼承來源 ComponentDesigner)
RaiseComponentChanging(MemberDescriptor)

通知該 IComponentChangeService 元件即將被更改。

(繼承來源 ComponentDesigner)
RaiseResizeEvent()
已淘汰.

引發 OnControlResize() 事件。

(繼承來源 ControlDesigner)
RefreshSchema(Boolean)

從底層資料來源刷新結構。

(繼承來源 SqlDataSourceDesigner)
RegisterClone(Object, Object)

將內部資料登錄在克隆控制中。

(繼承來源 ControlDesigner)
ResumeDataSourceEvents()

在資料來源事件被抑制後,還原資料來源事件。

(繼承來源 DataSourceDesigner)
SetEditableDesignerRegionContent(EditableDesignerRegion, String)

指定設計時控制項可編輯區域的內容。

(繼承來源 ControlDesigner)
SetRegionContent(EditableDesignerRegion, String)

在控制項設計時視圖中指定可編輯區域的內容。

(繼承來源 ControlDesigner)
SetViewFlags(ViewFlags, Boolean)

將指定的位 ViewFlags 元列舉分配給指定的旗標值。

(繼承來源 ControlDesigner)
SuppressDataSourceEvents()

將所有資料來源事件延後到方法被呼叫之後 ResumeDataSourceEvents() 。

(繼承來源 DataSourceDesigner)
ToString()

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

(繼承來源 Object)
UpdateDesignTimeHtml()

透過呼叫 GetDesignTimeHtml 該方法,刷新相關網頁伺服器控制項的設計時 HTML 標記。

(繼承來源 ControlDesigner)

事件

名稱 Description
DataSourceChanged

當相關資料來源的任何屬性改變時,就會發生這種情況。

(繼承來源 DataSourceDesigner)
SchemaRefreshed

發生在結構更新後。

(繼承來源 DataSourceDesigner)

明確介面實作

名稱 Description
IDesignerFilter.PostFilterAttributes(IDictionary)

關於此成員的描述,請參見方法。PostFilterAttributes(IDictionary)

(繼承來源 ComponentDesigner)
IDesignerFilter.PostFilterEvents(IDictionary)

關於此成員的描述,請參見方法。PostFilterEvents(IDictionary)

(繼承來源 ComponentDesigner)
IDesignerFilter.PostFilterProperties(IDictionary)

關於此成員的描述,請參見方法。PostFilterProperties(IDictionary)

(繼承來源 ComponentDesigner)
IDesignerFilter.PreFilterAttributes(IDictionary)

關於此成員的描述,請參見方法。PreFilterAttributes(IDictionary)

(繼承來源 ComponentDesigner)
IDesignerFilter.PreFilterEvents(IDictionary)

關於此成員的描述,請參見方法。PreFilterEvents(IDictionary)

(繼承來源 ComponentDesigner)
IDesignerFilter.PreFilterProperties(IDictionary)

關於此成員的描述,請參見方法。PreFilterProperties(IDictionary)

(繼承來源 ComponentDesigner)
ITreeDesigner.Children

關於此成員的描述,請參見 Children 該物業。

(繼承來源 ComponentDesigner)
ITreeDesigner.Parent

關於此成員的描述,請參見 Parent 該物業。

(繼承來源 ComponentDesigner)

適用於

另請參閱