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
| Public Sub TriUnite()
DicoUnite.Clear()
For Each mAlarme As Alarme In DicoAlarme.Values
If DicoUnite.ContainsKey(mAlarme.Location) = False Then
Dim mUnite As New Unite
mUnite.Name = mAlarme.Location
DicoUnite.Add(mUnite.Name, mUnite)
If mAlarme.Priority = "Urgent" Then
DicoUnite(mAlarme.Location).LengthUrgent += 1
ElseIf mAlarme.Priority = "High" Then
DicoUnite(mAlarme.Location).LengthHigh += 1
ElseIf mAlarme.Priority = "Low" Then
DicoUnite(mAlarme.Location).LengthLow += 1
End If
Else
If mAlarme.Priority = "Urgent" Then
DicoUnite(mAlarme.Location).LengthUrgent += 1
ElseIf mAlarme.Priority = "High" Then
DicoUnite(mAlarme.Location).LengthHigh += 1
ElseIf mAlarme.Priority = "Low" Then
DicoUnite(mAlarme.Location).LengthLow += 1
End If
End If
Next
End Sub
Public Sub RemplireListImageTreeView()
Dim myImageList As New ImageList()
myImageList.Images.Add(DicoImageBis.Item("Image0"))
myImageList.Images.Add(DicoImageBis.Item("Image2"))
myImageList.Images.Add(DicoImageBis.Item("Image4"))
FenGestionnaire.TreeViewUnite.ImageList = myImageList
End Sub
Public Sub RemplireLocationUnite()
Dim NiveauUrgent As Boolean = False
Dim NiveauHigh As Boolean = False
Dim NiveauLow As Boolean = False
FenGestionnaire.TreeViewUnite.Nodes.Clear()
FenGestionnaire.TreeViewUnite.Nodes.Add("Simulateur", "Simulateur")
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").ImageIndex = 0
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").SelectedImageIndex = 0
For Each mUnite As Unite In DicoUnite.Values
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").Nodes.Add(mUnite.Name, mUnite.Name & "(" & mUnite.LengthUrgent + mUnite.LengthHigh + mUnite.LengthLow & ")")
If mUnite.LengthUrgent > 0 Then
NiveauUrgent = True
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").Nodes(mUnite.Name).ImageIndex = 0
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").Nodes(mUnite.Name).SelectedImageIndex = 0
ElseIf mUnite.LengthHigh > 0 Then
NiveauHigh = True
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").Nodes(mUnite.Name).ImageIndex = 1
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").Nodes(mUnite.Name).SelectedImageIndex = 1
ElseIf mUnite.LengthLow > 0 Then
NiveauLow = True
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").Nodes(mUnite.Name).ImageIndex = 2
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").Nodes(mUnite.Name).SelectedImageIndex = 2
End If
Next
If NiveauUrgent = True Then
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").ImageIndex = 0
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").SelectedImageIndex = 0
ElseIf NiveauHigh = True Then
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").ImageIndex = 1
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").SelectedImageIndex = 1
ElseIf NiveauLow = True Then
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").ImageIndex = 2
FenGestionnaire.TreeViewUnite.Nodes("Simulateur").SelectedImageIndex = 2
End If
End Sub |