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
|
Private Function actionDeleteAll()
'but : destruction de fichiers
Dim list As String(,)
Dim iniPays As String()
ReDim iniPays(5)
Dim numberAll As Integer = Me.getAllRegisterNumberXMLAndHTML
'MsgBox(numberAll)
Dim objTree As classArbre
Dim objXML As ClassXML
Dim objHTML As ClassHTML
Dim i As Integer = 0
Dim j As Integer = 0
Me.myForm.ControlBox = False
' ************************************************************************
' ------------------------------------------------------------------------
' Actions direct sur les objects
' ------------------------------------------------------------------------
'Modification du contenu du label box
Me.lblDelete.text = "Suppression en cours..."
' ------------------------------------------------------------------------
' Paramétrage de la progress bar
Me.pbEvolution.maximum = numberAll
'Me.pbEvolution.maximum = 100
Me.pbEvolution.minimum = 0
Me.pbEvolution.value = 0
Me.pbEvolution.Step = 1
' -------------------------------------------------------------------------
' Cache des boutons Annuler, Confirmer, Fermer
Me.btnCancel.Hide()
Me.btnConfirm.Hide()
' Paramétrage du bouton Fermer
Me.btnClose.Hide()
Me.btnClose.Size = New Size(60, 25)
Me.btnClose.Location = New Point(230, 150)
' -------------------------------------------------------------------------
' Positionnement et affichage de la progress bar
Me.pbEvolution.size = New Size(450, 20)
Me.pbEvolution.Location = New Point(55, 120)
Me.pbEvolution.show()
' -------------------------------------------------------------------------
' timer pour ralentir le prog
' Positionnement et affichage du bouton Annuler Action
Me.btnCancelAction.Show()
Me.btnCancelAction.Enabled = True
Me.btnCancelAction.Size = New Size(60, 25)
Me.btnCancelAction.Location = New Point(230, 150)
Me.btnCancelAction.Focus()
' MsgBox("btn Annuler Action Tests")
' --------------------------------------------------------------------------
' **************************************************************************
iniPays(0) = "fr"
iniPays(1) = "de"
iniPays(2) = "us"
iniPays(3) = "uk"
iniPays(4) = "it"
iniPays(5) = "es"
Me.boolAction = True
For i = 0 To iniPays.GetUpperBound(0)
objTree = New classArbre(iniPays(i))
list = objTree.getListThemeAndXMLAndHTML
For j = 0 To list.GetUpperBound(0)
If Me.boolAction = False Then
Exit Function
Else
If (list(j, 2).ToLower <> "null") Then
objHTML = New ClassHTML
objHTML.Delete(list(j, 0), iniPays(i))
objHTML.Destroy()
Me.pbEvolution.performstep()
End If
objXML = New ClassXML
objXML.Delete(list(j, 0), iniPays(i))
objXML.destroy()
Me.pbEvolution.performstep()
End If
Next
Next
'MsgBox("terminado")
Me.lblDelete.text = "La suppression de tous les enregistrements est terminée !"
Me.pbEvolution.Hide()
Me.btnCancelAction.Hide()
Me.btnClose.enabled = True
Me.myForm.ControlBox = True
Me.btnClose.show()
End Function |
Partager