home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / dump_s1r / files.cls < prev    next >
Encoding:
Visual Basic class definition  |  1998-12-21  |  1.3 KB  |  60 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "Files"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = False
  10. Option Explicit
  11. Private mCol As Collection
  12.  
  13. Public Function Add(FileName As String, IDName As String, Optional sKey As String) As clsFFile
  14.     Dim objNewMember As clsFFile
  15.     Set objNewMember = New clsFFile
  16.     objNewMember.FileName = FileName
  17.     objNewMember.IDName = IDName
  18.     If Len(sKey) = 0 Then
  19.         mCol.Add objNewMember
  20.     Else
  21.         mCol.Add objNewMember, sKey
  22.     End If
  23.     Set Add = objNewMember
  24.     Set objNewMember = Nothing
  25.  
  26.  
  27. End Function
  28.  
  29. Public Property Get Item(vntIndexKey As Variant) As clsFFile
  30. Attribute Item.VB_UserMemId = 0
  31.   Set Item = mCol(vntIndexKey)
  32. End Property
  33.  
  34. Public Property Get Count() As Long
  35.     Count = mCol.Count
  36. End Property
  37.  
  38.  
  39. Public Sub Remove(vntIndexKey As Variant)
  40.     mCol.Remove vntIndexKey
  41. End Sub
  42.  
  43.  
  44. Public Property Get NewEnum() As IUnknown
  45. Attribute NewEnum.VB_UserMemId = -4
  46. Attribute NewEnum.VB_MemberFlags = "40"
  47.     Set NewEnum = mCol.[_NewEnum]
  48. End Property
  49.  
  50.  
  51. Private Sub Class_Initialize()
  52.     Set mCol = New Collection
  53. End Sub
  54.  
  55.  
  56. Private Sub Class_Terminate()
  57.     Set mCol = Nothing
  58. End Sub
  59.  
  60.