日期:2014-05-17 浏览次数:20465 次
Namespace UI.WebControls
<ToolboxData("<{0}:GameBox runat=""server""></{0}:GameBox>")> _
<Designer(GetType(GameBoxDesigner))> _
Public Class GameBox
Inherits CompositeControl
Implements INamingContainer
Private _template As ITemplate
Public _box As GameBoxContainer
Protected Overrides ReadOnly Property TagKey() As System.Web.UI.HtmlTextWriterTag
Get
Return HtmlTextWriterTag.Div
End Get
End Property
<PersistenceMode(PersistenceMode.InnerProperty)> _
<DefaultValue(GetType(ITemplate), "")> _
<TemplateContainer(GetType(GameBoxContainer))> _
Public Property View() As ITemplate
Get
Return _template
End Get
Set(ByVal value As ITemplate)
_template = value
End Set
End Property
Protected Overrides Sub CreateChildControls()
Me.Controls.Clear()
_box = New GameBoxContainer
_box.BackColor = Drawing.Color.Beige
If Me.View IsNot Nothing Then
Me.View.InstantiateIn(_box)
End If
Me.Controls.Add(_box)
End Sub
End Class
#Region "容器对象"
Public Class GameBoxContainer
Inherits WebControl
Implements INamingContainer