1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
<DefaultProperty("Text"), ToolboxData("<{0}:WclRecherche runat=server></{0}:WclRecherche>")> _
Public Class WclRecherche
Inherits WebControls.Panel
Public Enum TypeRecherche
NomCommune
CodePostal
CodeInsee
End Enum
Protected lRecherche As Label = New Label
Protected tbRecherche As TextBox = New TextBox
Protected btRecherche As Button = New Button
<Bindable(True), Category("Interface"), DefaultValue(GetType(String), Nothing), _
DisplayName("Entête"), Browsable(True), _
Description("Texte figurant sur l'entête de l'interface")> _
Property strEntete() As String
Get
Dim s As String = CStr(ViewState("strEntete"))
If s Is Nothing Then
Return String.Empty
Else
Return s
End If
End Get
Set(ByVal Value As String)
ViewState("strEntete") = Value
End Set
End Property
<Bindable(False), Category("Entrée"), Browsable(True), _
DisplayName("Type de recherche"), _
DefaultValue(TypeRecherche.NomCommune), _
Description("Recherche à partir de différentes entrées disponibles.")> _
Property Type_Source_Recherche() As TypeRecherche
Get
Return ViewState("TypeRecherche")
End Get
Set(ByVal value As TypeRecherche)
ViewState("TypeRecherche") = value
End Set
End Property
<Bindable(False), Category("Interface"), Browsable(True), DefaultValue(True), _
DisplayName("Interface de sélection"), _
Description("Faut-il afficher une interface de sélection ?")> _
Property ysnInterfaceSelection() As Boolean
Get
Return ViewState("ysnInterfaceSelection")
End Get
Set(ByVal value As Boolean)
ViewState("ysnInterfaceSelection") = value
End Set
End Property
<Bindable(False), Category("Interface"), DefaultValue("Valider"), _
DisplayName("Texte du bouton de validation"), _
Description("Texte affiché sur le bouton de validation.")> _
Property btValidText() As String
Get
Dim s As String = CStr(ViewState("btValidText"))
If s Is Nothing Then
Return String.Empty
Else
Return s
End If
End Get
Set(ByVal Value As String)
ViewState("btValidText") = Value
End Set
End Property
<Bindable(False), Category("Interface"), DefaultValue("Annuler"), _
DisplayName("Texte du bouton d'annulation"), _
Description("Texte affiché sur le bouton de validation.")> _
Property btCancelText() As String
Get
Dim s As String = CStr(ViewState("btCancelText"))
If s Is Nothing Then
Return String.Empty
Else
Return s
End If
End Get
Set(ByVal Value As String)
ViewState("btCancelText") = Value
End Set
End Property
Protected Overrides Sub CreateChildControls()
Controls.Clear()
lRecherche.Text = "Recherche"
btRecherche.Text = "Rechercher"
Me.Controls.Add(lRecherche)
Me.Controls.Add(tbRecherche)
Me.Controls.Add(btRecherche)
End Sub
Protected Overrides Sub RenderContents(ByVal output As HtmlTextWriter)
CreateChildControls()
'Me.BackColor = Drawing.Color.AliceBlue
'Me.BorderStyle = WebControls.BorderStyle.Dotted
'Me.BorderColor = Drawing.Color.Red
'Me.BorderWidth = Unit.Pixel(1)
Me.RenderChildren(output)
output.Write(strEntete & "tt")
'output.Write("TEST")
End Sub
#Region "Traitement"
#End Region
End Class |