VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "CL_GroupeInformation_Coll"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'//////////////////////////////////////////////////////// MODULE DE CLASSE
Option Explicit
'### ENUMERATIONS/TYPES
'### VARIABLES
Private m_Coll As Collection
'###INITIALISATION ET FINALE
Private Sub Class_Initialize()
Set m_Coll = New Collection
End Sub
Private Sub Class_Terminate()
Set m_Coll = Nothing
End Sub
'###PROPRIETES
Public Property Get Item(ByVal vntIndexKey As Variant) As CL_GroupeInformation
Attribute Item.VB_UserMemId = 0
On Error Resume Next
Set Item = m_Coll(vntIndexKey)
End Property
Public Property Let Item(ByVal vntIndexKey As Variant, ByVal Valeur As CL_GroupeInformation)
On Error Resume Next
Set m_Coll(vntIndexKey) = Valeur
End Property
Public Property Get Count() As Long
Count = m_Coll.Count
End Property
'###PROCEDURES
Public Function Add(Optional ByVal Key As String) As CL_GroupeInformation
On Error GoTo er
Dim OBJ As Object, NObj As CL_GroupeInformation
Set NObj = New CL_GroupeInformation
'NObj.Key = key
m_Coll.Add NObj, Key
Set Add = NObj
Set NObj = Nothing
Exit Function
'Traitement des erreurs
er:
If vbYes = MsgBox("Erreur dans la définition de l'objet groupe d'information (Clé :" & Key & ")" & vbCrLf & vbCrLf & _
"Voulez-vous arrêter l'exécution du programme?", vbExclamation + vbYesNo) Then
End
End If
End Function
Public Sub Remove(ByVal VIndex As Variant)
m_Coll.Remove VIndex
End Sub
Public Function NewEnum() As IUnknown
Set NewEnum = m_Coll.[_NewEnum]
End Function
Public Sub Clear()
Dim I As Long
If m_Coll.Count = 0 Then Exit Sub
Do While m_Coll.Count <> 0
m_Coll.Remove m_Coll.Count
Loop
End Sub