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 141 142 143 144 145
| Imports Elan2.UserControls._Common.List
Namespace UserControls
Namespace _Common.Misc
''' <summary>
''' Table de mise en forme d'un titre de page.
''' </summary>
''' <remarks>Permet de mettre en forme un titre de page avec icone + titre h5</remarks>
Partial Public Class ucPopup
Inherits System.Web.UI.UserControl
#Region "Eveneemnts"
Public Event Cancel()
Public Event Quit()
#End Region
#Region "Chargement du popup"
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Javascript.AddJavascript("$('#" & divDialog.ClientID & "').draggable({handle: '.modal-header'});")
If (Not Contents Is Nothing) Then Contents.InstantiateIn(plhMain)
End Sub
#End Region
#Region "Affichage du popup"
Public Sub ShowPopup()
Javascript.AddJavascript("$('#" & panMain.ClientID & "').modal('show');")
End Sub
#End Region
#Region "Constante du chemin par défaut des images utilisée avec ShortImageSource"
Public Const ShortImagePath As String = "~/Pictures/16x16/"
#End Region
#Region "Propriétés du titre"
Public Property Title As String
Get
Return lblTitle.Text
End Get
Set(value As String)
lblTitle.Text = value
End Set
End Property
Public Property ShowTitleImageText() As Boolean
Get
Return imgText.Visible
End Get
Set(ByVal value As Boolean)
imgText.Visible = value
End Set
End Property
Public Property ShowTitleImage() As Boolean
Get
Return imgMain.Visible
End Get
Set(ByVal value As Boolean)
imgMain.Visible = value
End Set
End Property
Public Property TitleImageText As String
Get
If Not imgText.Attributes("class") Is Nothing Then
Return imgText.Attributes("class").Replace("fa ", "").Replace(" fa-fw", "")
Else
Return Nothing
End If
End Get
Set(value As String)
imgText.Attributes("class") = String.Concat("fa ", value, " fa-fw")
End Set
End Property
Public Property TitleImageSource() As String
Get
Return imgMain.ImageUrl
End Get
Set(ByVal value As String)
imgMain.ImageUrl = value
End Set
End Property
Public Property TitleShortImageSource() As String
Get
Return imgMain.ImageUrl.Replace(ShortImagePath, "")
End Get
Set(ByVal value As String)
imgMain.ImageUrl = ShortImagePath & value
End Set
End Property
Public Property TitleIMageTooltip() As String
Get
Return imgMain.ToolTip
End Get
Set(ByVal value As String)
imgMain.ToolTip = value
End Set
End Property
Public WriteOnly Property TitleImageRightMargin() As Integer
Set(ByVal value As Integer)
imgMain.Style.Add("margin-right", CStr(value) & "px")
End Set
End Property
#End Region
#Region "Contenu du popup"
<TemplateContainer(GetType(TemplateControl))> _
<PersistenceMode(PersistenceMode.InnerProperty)> _
<TemplateInstance(TemplateInstance.Single)>
Public Property Contents As ITemplate
#End Region
#Region "Boutons du popup"
'Bouton Annuler
Public Property ButtonCancelVisible As Boolean
Get
Return ucLnkCancel.Visible
End Get
Set(value As Boolean)
ucLnkCancel.Visible = value
End Set
End Property
'Boton quitter
Public WriteOnly Property ButtonQuitType As Elan2Utils.Enumerations._Common.Button.ButtonType
Set(value As Elan2Utils.Enumerations._Common.Button.ButtonType)
ucLnkQuit.ButtonType = value
End Set
End Property
Public Property ButtonQuitText As String
Get
Return ucLnkQuit.Text
End Get
Set(value As String)
ucLnkQuit.Text = value
End Set
End Property
Private Sub ucLnkCancel_Click(sender As Object, e As EventArgs) Handles ucLnkCancel.Click
RaiseEvent Cancel()
End Sub
Private Sub ucLnkQuit_Click(sender As Object, e As EventArgs) Handles ucLnkQuit.Click
RaiseEvent Quit()
End Sub
#End Region
End Class
End Namespace
End Namespace |
Partager