本文整理汇总了VB.NET中System.Web.UI.Design.TemplateGroupCollection类的典型用法代码示例。如果您正苦于以下问题:VB.NET TemplateGroupCollection类的具体用法?VB.NET TemplateGroupCollection怎么用?VB.NET TemplateGroupCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TemplateGroupCollection类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: TemplateGroup
' 导入命名空间
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Imports System.Web.UI.Design.WebControls
Imports System.ComponentModel
Imports System.ComponentModel.Design
Namespace Examples.AspNet
' Define a simple control designer that adds a
' template group to the template group collection.
Class DerivedControlDesigner
Inherits System.Web.UI.Design.ControlDesigner
Private Dim internalControl As DerivedControl = Nothing
Private Const templateGroupName As String = "My template group"
Private Const templateDefinitionName1 As String = "First"
Private Const templateDefinitionName2 As String = "Second"
Private Dim internalGroup As TemplateGroup = Nothing
' Override the read-only TemplateGroups property.
' Get the base group collection, and add a group
' with two template definitions for the derived
' control designer.
Public Overrides ReadOnly Property TemplateGroups As TemplateGroupCollection
Get
' Start with the groups defined by the base designer class.
Dim groups As TemplateGroupCollection = MyBase.TemplateGroups
If internalGroup Is Nothing
' Define a new group with two template definitions.
internalGroup = New TemplateGroup(templateGroupName, _
internalControl.ControlStyle)
Dim templateDef1 As TemplateDefinition = new TemplateDefinition(Me, _
templateDefinitionName1, internalControl, _
templateDefinitionName1, internalControl.ControlStyle)
Dim templateDef2 As TemplateDefinition = new TemplateDefinition(Me, _
templateDefinitionName2, internalControl, _
templateDefinitionName2, internalControl.ControlStyle)
internalGroup.AddTemplateDefinition(templateDef1)
internalGroup.AddTemplateDefinition(templateDef2)
End If
' Add the new template group to the collection.
groups.Add(internalGroup)
return groups
End Get
End Property
End Class
' Simple Web control, derived from the Web control class.
<DesignerAttribute(GetType(DerivedControlDesigner), GetType(IDesigner))> _
Public Class DerivedControl
Inherits WebControl
' Define derived control behavior here.
End Class
End Namespace
开发者ID:VB.NET开发者,项目名称:System.Web.UI.Design,代码行数:69,代码来源:TemplateGroupCollection
注:本文中的System.Web.UI.Design.TemplateGroupCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论