AccessDataSourceDesigner 类   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在可视化设计器中为 AccessDataSource Web 服务器控件提供设计时支持。
public ref class AccessDataSourceDesigner : System::Web::UI::Design::WebControls::SqlDataSourceDesignerpublic class AccessDataSourceDesigner : System.Web.UI.Design.WebControls.SqlDataSourceDesignertype AccessDataSourceDesigner = class
    inherit SqlDataSourceDesignerPublic Class AccessDataSourceDesigner
Inherits SqlDataSourceDesigner- 继承
- 
				AccessDataSourceDesigner
示例
本部分提供两个代码示例。 第一个示例演示如何扩展 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 标记源代码,并在设计图面上创建控件的设计时版本,该版本只是一个占位符。 切换回“源”视图时,设计时控件(包括 “属性” 网格中属性的值)将保留到标记源代码中,并编辑为网页的标记。
构造函数
| AccessDataSourceDesigner() | 初始化 AccessDataSource 类的新实例。 | 
属性
方法
事件
| DataSourceChanged | 当关联数据源的任何属性发生更改时发生。(继承自 DataSourceDesigner) | 
| SchemaRefreshed | 在架构刷新后发生。(继承自 DataSourceDesigner) | 
显式接口实现
| 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) |