本文整理汇总了VB.NET中System.Web.UI.Design.WebControls.ObjectDataSourceDesigner类的典型用法代码示例。如果您正苦于以下问题:VB.NET ObjectDataSourceDesigner类的具体用法?VB.NET ObjectDataSourceDesigner怎么用?VB.NET ObjectDataSourceDesigner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ObjectDataSourceDesigner类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: PreFilterProperties
' 导入命名空间
Imports System.Web
Imports System.Web.UI.WebControls
Imports System.Web.UI.Design.WebControls
Imports System.Collections
Imports System.ComponentModel
Imports System.Security.Permissions
Namespace Examples.VB.WebControls.Design
' The MyObjectDataSource is a copy of the ObjectDataSource.
<AspNetHostingPermission(SecurityAction.Demand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
<Designer(GetType(Examples.VB.WebControls.Design. _
MyObjectDataSourceDesigner))> _
Public Class MyObjectDataSource
Inherits ObjectDataSource
End Class
' Derive a designer that inherits from the ObjectDataSourceDesigner.
<ReflectionPermission(SecurityAction.Demand, Flags:=ReflectionPermissionFlag.MemberAccess)> _
Public Class MyObjectDataSourceDesigner
Inherits ObjectDataSourceDesigner
' Generate the design-time markup.
Public Overrides Function GetDesignTimeHtml() As String
' Get a reference to the control or a copy of the control.
Dim myODS As MyObjectDataSource = _
CType(ViewControl, MyObjectDataSource)
Dim markup As String = _
CreatePlaceHolderDesignTimeHtml( _
"<b>TypeName</b> """ & myODS.TypeName & """<br />" & _
"<b>SelectMethod</b> """ & myODS.SelectMethod & """")
Return markup
End Function ' GetDesignTimeHtml
' Shadow the control properties with design-time properties.
Protected Overrides Sub PreFilterProperties( _
ByVal properties As IDictionary)
' Call the base method first.
MyBase.PreFilterProperties(properties)
' Make the NamingContainer visible in the Properties grid.
Dim selectProp As PropertyDescriptor = _
CType(properties("NamingContainer"), PropertyDescriptor)
properties("NamingContainer") = _
TypeDescriptor.CreateProperty(selectProp.ComponentType, _
selectProp, BrowsableAttribute.Yes)
End Sub
End Class
End Namespace ' Examples.VB.WebControls.Design