Skip to content

Commit

Permalink
Fixed up html encoding and code blocks in 2005 posts.
Browse files Browse the repository at this point in the history
Updated barryclark#39; to '
  • Loading branch information
roryprimrose committed Feb 18, 2015
1 parent 275e062 commit 6158fee
Show file tree
Hide file tree
Showing 43 changed files with 979 additions and 2,017 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,186 +19,152 @@ So far, the control has properties defined like this:

{% highlight vb.net linenos %}
< _
Description("The Key value to identify the purpose of the button."), _
Category("Client") _
Description("The Key value to identify the purpose of the button."), _
Category("Client") _
> _
Public Property Key() As String
Get

Get
' Return the stored value
Return CType (ViewState.Item("Key"), String )

' Return the stored value
End Get
Set ( ByVal Value As String )

Return CType (ViewState.Item("Key"), String )

End Get

Set ( ByVal Value As String )

' Store the new value

ViewState.Item("Key") = Value

End Set
' Store the new value
ViewState.Item("Key") = Value

End Set
End Property

< _
Description("The client function to call when the control is clicked."), _
Category("Client") _
Description("The client function to call when the control is clicked."), _
Category("Client") _
> _
Public Property ClientClickHandler() As String
Get

Get

' Return the stored value

Return CType (ViewState.Item("ClientClickHandler"), String )

End Get

Set ( ByVal Value As String )
' Return the stored value
Return CType (ViewState.Item("ClientClickHandler"), String )

' Ensure that no brackets or parameters are defined
End Get
Set ( ByVal Value As String )

If Value <> vbNullString _
' Ensure that no brackets or parameters are defined
If Value <> vbNullString _
AndAlso Value.IndexOf("(") > -1 Then Value = Value.Substring(0, Value.IndexOf("("))

AndAlso Value.IndexOf("(") > -1 Then Value = Value.Substring(0, Value.IndexOf("("))

' Store the new value

ViewState.Item("ClientClickHandler") = Value

End Set
' Store the new value
ViewState.Item("ClientClickHandler") = Value

End Set
End Property

< _
Description("The Url to the image to use when the mouse is down on the control or the control is selected."), _
Category("Appearance") _
Description("The Url to the image to use when the mouse is down on the control or the control is selected."), _
Category("Appearance") _
> _
Public Property ImageDownUrl() As String
Get

Get

' Return the stored value

Return CType (ViewState.Item("ImageDownUrl"), String )

End Get

Set ( ByVal Value As String )

' Store the new value
' Return the stored value
Return CType (ViewState.Item("ImageDownUrl"), String )

ViewState.Item("ImageDownUrl") = Value
End Get
Set ( ByVal Value As String )

End Set
' Store the new value
ViewState.Item("ImageDownUrl") = Value

End Set
End Property

< _
Description("The Url to the image to use when the mouse is hover the control."), _
Category("Appearance") _
Description("The Url to the image to use when the mouse is hover the control."), _
Category("Appearance") _
> _
Public Property ImageHoverUrl() As String
Get

Get
' Return the stored value
Return CType (ViewState.Item("ImageHoverUrl"), String )

' Return the stored value
End Get
Set ( ByVal Value As String )

Return CType (ViewState.Item("ImageHoverUrl"), String )

End Get

Set ( ByVal Value As String )

' Store the new value

ViewState.Item("ImageHoverUrl") = Value

End Set
' Store the new value
ViewState.Item("ImageHoverUrl") = Value

End Set
End Property

< _
Description("Determines whether the button is selected or not."), _
Category("Appearance"), _
DefaultValue( False ) _
Description("Determines whether the button is selected or not."), _
Category("Appearance"), _
DefaultValue( False ) _
> _
Public Property Selected() As Boolean
Get

Get

' Get the stored value

Dim objValue As Object = ViewState.Item("Selected")

' Check if the type of object is a boolean

If TypeOf objValue Is Boolean Then
' Get the stored value
Dim objValue As Object = ViewState.Item("Selected")

' Return the stored value
' Check if the type of object is a boolean
If TypeOf objValue Is Boolean Then

Return CType (objValue, Boolean )
' Return the stored value
Return CType (objValue, Boolean )

Else ' This is not a boolean
Else ' This is not a boolean

' Return the default value
' Return the default value
Return False

Return False
End If ' End checking if the type of object is a boolean

End If ' End checking if the type of object is a boolean
End Get

End Get
Set ( ByVal Value As Boolean )

Set ( ByVal Value As Boolean )
' Store the new value
ViewState.Item("Selected") = Value

' Store the new value

ViewState.Item("Selected") = Value

End Set
End Set

End Property

< _
Description("Determines whether the button is a toggle button or not."), _
Category("Appearance"), _
DefaultValue( False ) _
Description("Determines whether the button is a toggle button or not."), _
Category("Appearance"), _
DefaultValue( False ) _
> _
Public Property IsToggle() As Boolean
Get

Get

' Get the stored value

Dim objValue As Object = ViewState.Item("IsToggle")

' Check if the type of object is a boolean

If TypeOf objValue Is Boolean Then

' Return the stored value

Return CType (objValue, Boolean )
' Get the stored value
Dim objValue As Object = ViewState.Item("IsToggle")

Else ' This is not a boolean
' Check if the type of object is a boolean
If TypeOf objValue Is Boolean Then

' Return the default value
' Return the stored value
Return CType (objValue, Boolean )

Return False
Else ' This is not a boolean

End If ' End checking if the type of object is a boolean
' Return the default value
Return False

End Get
End If ' End checking if the type of object is a boolean

Set ( ByVal Value As Boolean )
End Get

' Store the new value
Set ( ByVal Value As Boolean )

ViewState.Item("IsToggle") = Value
' Store the new value
ViewState.Item("IsToggle") = Value

End Set
End Set

End Property
{% endhighlight %}
Expand All @@ -210,27 +176,27 @@ Ok, now lets render these property values to the control HTML tag as custom attr
{% highlight vb.net linenos %}
Protected Overrides Sub OnPreRender( ByVal e As System.EventArgs)

With Attributes
With Attributes

' Ensure that the id attribute is rendered
If ID = vbNullString Then .Add("id", ClientID)
' Ensure that the id attribute is rendered
If ID = vbNullString Then .Add("id", ClientID)

' Add the attributes if they are specified
If Key <> vbNullString Then .Add("Key", Key)
' Add the attributes if they are specified
If Key <> vbNullString Then .Add("Key", Key)

If ImageDownUrl <> vbNullString Then .Add("ImageDownUrl", ImageDownUrl)
If ImageDownUrl <> vbNullString Then .Add("ImageDownUrl", ImageDownUrl)

If ImageHoverUrl <> vbNullString Then .Add("ImageHoverUrl", ImageHoverUrl)
If ImageHoverUrl <> vbNullString Then .Add("ImageHoverUrl", ImageHoverUrl)

If ClientClickHandler <> vbNullString Then .Add("ClientClickHandler", ClientClickHandler)
If ClientClickHandler <> vbNullString Then .Add("ClientClickHandler", ClientClickHandler)

.Add("Selected", Selected.ToString.ToLower)
.Add("IsToggle", IsToggle.ToString.ToLower)
.Add("Selected", Selected.ToString.ToLower)
.Add("IsToggle", IsToggle.ToString.ToLower)

End With ' End With Attributes
End With ' End With Attributes

' Allow the base class code to run
Call MyBase .OnPreRender(e)
' Allow the base class code to run
Call MyBase .OnPreRender(e)

End Sub
{% endhighlight %}
Expand Down
Loading

0 comments on commit 6158fee

Please sign in to comment.