home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Planet Source Code Jumbo …e CD Visual Basic 1 to 7
/
5_2007-2008.ISO
/
data
/
Zips
/
FileSystem206395542007.psc
/
Drives.cls
< prev
next >
Wrap
Text File
|
2007-04-29
|
4KB
|
106 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Drives"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
' =======================================================
'
' Hex Editor VB
' Coded by violent_ken (Alain Descotes)
'
' =======================================================
'
' A complete hexadecimal editor for Windows ⌐
' (Editeur hexadΘcimal complet pour Windows ⌐)
'
' Copyright ⌐ 2006-2007 by Alain Descotes.
'
' This file is part of Hex Editor VB.
'
' Hex Editor VB is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' Hex Editor VB is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with Hex Editor VB; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'
' =======================================================
Option Explicit
Private colDrives As Collection
'http://www.vbfrance.com/tutorial.aspx?ID=188
'=======================================================
'Permet d'utiliser For Each
'=======================================================
Public Function NewEnum() As IEnumVARIANT
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
'on renvoie l'objet d'ΘnumΘration
Set NewEnum = colDrives.[_NewEnum]
End Function
'Renvoie l'ΘlΘment d'index iCurrent dans la variable var
'elle doit renvoyer 0 si tout vabien
'1 s'il n'y a plus d'ΘlΘments dans la collection
Public Function ForEach(ByVal iCurrent As Long, var As Variant) As Long
Attribute ForEach.VB_MemberFlags = "40"
'
End Function
'=======================================================
'ProperiΘtΘs de la classe
'=======================================================
Public Property Get Count() As Long: Count = colDrives.Count: End Property
Public Property Get Item(Index As Long) As Drive: Set Item = colDrives(Index): End Property
Attribute Item.VB_UserMemId = 0
'=======================================================
'Subs d'initialisations
'=======================================================
Private Sub Class_Initialize(): Set colDrives = New Collection: End Sub
Private Sub Class_Terminate(): Set colDrives = Nothing: End Sub
'=======================================================
'Ajout d'un objet dans la collection
'=======================================================
Public Sub AddItem(VolumeLetter As String, Optional ByVal RefreshInfos As Boolean = True)
Dim tDrive As Drive
Set tDrive = New Drive
Call tDrive.SetVolumeLetter(VolumeLetter, RefreshInfos) 'refresh les infos du nouvel objet
Call colDrives.Add(Item:=tDrive)
End Sub
'=======================================================
'Suppression d'un objet de la collection
'=======================================================
Public Sub RemoveItem(Index As Long)
Call colDrives.Remove(Index)
End Sub